-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action on pull_request trigger is skipped even though base branch content changed #264
Comments
Thank you for the detailed report, @fknorr! As you can see in the logs of the However, once the pull request (celerity/test-skip-duplicate-actions#2) is merged into the Hope this helps! |
Thanks for taking a look at this @paescuj. I have updated the test setup to report in detail which revisions are checked out and what files are present (also I have deleted all old runs so there's no unexpected interactions). The actions script now runs git rev-parse HEAD
ls
echo ${{should_skip}}
The |
Of course, you're totally right! I must have been a bit tired and got things mixed up... 😄🙈 |
Unfortunately, I don't see any way to get the tree SHA from the merge commit for all workflow runs that were triggered by the pull request event. (See #270 for an unsuccessful attempt)
|
Thanks for giving this a try! I have looked into what actions/checkout does on pull requests, since it also needs to figure out the merge SHA on a From this it seems like the Action should not rely on the API at all for figuring out what commit to run on but do a Edit: Oh well, this only helps to get the commit SHA in the current job of course, not the "remote ones" (at least not without some log/communication hackery). |
One such hack could be to upload the SHA as a workflow artifact. Ugly but might just work..? |
Exactly 😄
Yeah, I was thinking about something like this. One "problem" with GitHub Actions is that you always need to keep an eye on the amount of API requests you're doing, otherwise you risk to run into the rate limit. |
A conservative solution could be to identify the cases we definitely know are duplicates, and keep the jobs for which we cannot be sure.
That means we can actively skip a |
I have the following workflow defined, which enables concurrent skipping and then simply echoes whether a run has been skipped or not.
Now I add a new file that only exists in the
main
branch, and an additional file that only exists in apr
branch. Now I create a pull request to mergepr
intomain
. Thepush
triggers for both branches are ran as expected.The
pull_request
triggers must not be skipped however, since the merge will contain both files, so the checked out contents differ from bothmain
andpr
. skip-duplicate-actions however reportsshould-skip = true
.See our test repo for a reproduction. Runs 6 and 11 are from push events, and 12 is from a
pull_request
trigger concurrent with its siblingpush
.The text was updated successfully, but these errors were encountered: