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
workflows: Improve the change check for issue_comment
triggers
#16841
workflows: Improve the change check for issue_comment
triggers
#16841
Conversation
Copying what I said on Slack regarding:
If you'd prefer to get the parent SHA, we already have a retrieval snippet here: cilium/.github/workflows/lint-build-commits.yaml Lines 57 to 62 in 41b821d
No idea what approach is most useful. |
e4f1ee4
to
4e85e2a
Compare
Thanks @nbusseneau for the suggestion! I've taken the approach you suggested. I think it's best, at least for consistency/readability. |
Joe reported that the CI 3.0 tests were triggered in his pull request, even though it only touched test/ code and we should skip those tests in that case [1]. The logs revealed that happened because the workflow had an incorrect view of the pull request diff (saw more changes than existed). To retrieve the set of changed files, we instruct the paths-filter GitHub action to compare .base.sha and .head.sha. .head.sha points to the tip of the pull request branch. .base.sha however doesn't point to the last master commit of the pull request branch (the commit on which the pull request is based). Instead it points to the latest master commit at the time you trigger the workflows. This commit fixes this by manually retrieving the base commit via the GitHub API. 1 - https://github.com/cilium/cilium/blob/v1.10.2/.github/workflows/conformance-aks.yaml#L69 Reported-by: Joe Stringer <joe@cilium.io> Suggested-by: Nicolas Busseneau <nicolas@isovalent.com> Signed-off-by: Paul Chaignon <paul@cilium.io>
4e85e2a
to
fd38ded
Compare
Joe reported that the CI 3.0 tests were triggered in his pull request, even though it only touched
test/
code and we should skip those tests in that case. The logs revealed that happened because the workflow had an incorrect view of the pull request diff (saw more changes than existed).To retrieve the set of changed files, we instruct the paths-filter GitHub action to compare
.base.sha
and.head.sha
..head.sha
points to the tip of the pull request branch..base.sha
however doesn't point to the last master commit of the pull request branch (the commit on which the pull request is based). Instead it points to the latest master commit at the time you trigger the workflows.This pull request fixes this by manually retrieving the base commit via the GitHub API.