Repository navigation
chore(ci): Avoid build twice the same commit on PR - #3708
Merged
jihuayu merged 3 commits intoOct 22, 2026
Merged
Conversation
|
Hi @apupier, Thank you for your pull request. Please review our Contributing Guide. Please make sure you understand your changes and explain your reasoning in this pull request. Low-quality pull requests may be closed. |
Author
|
for instance on this PR #3706 all
|
jihuayu
reviewed
Oct 21, 2026
Comment on lines
+23
to
+24
| - 2.17 | ||
| - 2.16 |
Member
There was a problem hiding this comment.
Suggested change
| - 2.17 | |
| - 2.16 | |
| - '*.*' | |
| - '*.*.*' | |
| - 'action/**' |
apupier
force-pushed
the
AvoidBuildingSamePRChangeSeveralTime
branch
2 times, most recently
from
October 21, 2026 16:06
3703171 to
29af762
Compare
A workflow with a push trigger and no branch filter fires on every
commit pushed to any
branch. When the same workflow also has a pull_request trigger this
causes it to run
twice for the same code — once for the PR and once for the push —
wasting runner resources.
The fix is to add a branches (or branches-ignore) filter to the push
trigger, e.g.:
on:
push:
branches:
- main
pull_request:
Reference best practice:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=430408443#GitHubActionsRecommendedPractices-Restrictthepushtriggertospecificbranches
Signed-off-by: Aurélien Pupier <apupier@ibm.com>
apupier
force-pushed
the
AvoidBuildingSamePRChangeSeveralTime
branch
from
October 21, 2026 16:07
29af762 to
8b4607c
Compare
aleksraiden
approved these changes
Oct 21, 2026
aleksraiden
enabled auto-merge (squash)
October 21, 2026 17:46
aleksraiden
disabled auto-merge
October 21, 2026 17:47
git-hulk
approved these changes
Oct 22, 2026
jihuayu
approved these changes
Oct 22, 2026
jihuayu
enabled auto-merge (squash)
October 22, 2026 02:09
PragmaTwice
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

A workflow with a push trigger and no branch filter fires on every commit pushed to any
branch. When the same workflow also has a pull_request trigger this causes it to run
twice for the same code — once for the PR and once for the push — wasting runner resources.
The fix is to add a branches (or branches-ignore) filter to the push trigger, e.g.:
on:
push:
branches:
- main pull_request:
Reference best practice:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=430408443#GitHubActionsRecommendedPractices-Restrictthepushtriggertospecificbranches