-
Notifications
You must be signed in to change notification settings - Fork 54
Improve eamxx workflow files #3081
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
Improve eamxx workflow files #3081
Conversation
ba07d7c
to
0673f5d
Compare
Fun fact: the dummy PR #3082 revealed, after some debugging, an important detail, which makes this PR actually necessary! Apparently, the if condition at the job level (which is what we do right now, before this PR) must be evaluated when the worfklow is parsed, so it's a static condition. The PR labels are considered by gh as a dynamic information, coming from the event payload. Hence, we cannot check them at the job level. Incidentally, the check
is ok, despite having the "inputs.jobs_list" part, which seems a whole lot like an event payload. The point is that this particular payload is available to gh when the workflow is parsed, so we can check in an if condition at the job level. You live you learn... |
ad77c42
to
e43973b
Compare
* Print workflow trigger * Check skip labels
e43973b
to
a10399b
Compare
The new checks that triggered with the review are rejected b/c Naser is not part of snl-testing. But the tests are the same of the ones triggered by pull_request event, so I'm going to ignore them and merge. |
we can try to improve all of this later, but it is not urgent |
It should have run if you approved it, right? Has that been tested? |
I yeah, it ran and it failed when I approved it: https://github.com/E3SM-Project/scream/actions/runs/11618416678/job/32355783369. Recall I am not authorized. |
I mean if Luca, Jim or Tom approved it. |
Yeah, we can verify that on other PRs. The actions can be triggered manually too. see here https://github.com/E3SM-Project/scream/actions/runs/11618827760 how it lists the details:
|
This PR does a few improvements to the eamxx workflow files:
pull_request
andpull_request_review
events, check if the PR labels contain any relevant skip labelNotice that the check on the labels for PR runs is now done at run time, while before it was a conditional at the job level. As a consequence, we no longer skip the job based on label (in the sense that the job did not run, so did not use runner resources). The reason for this is that while for
pull_request
events we can check the labels from the gh context (so we can do it at the job level), forpull_request_event
the context does NOT contain the PR labels list, so we need to ping github for some info, and cannot do that inside the if conditional at the job level. The only downsides areImho, the downsides are relatively mild,
also considering that the check is done BEFORE cloning the repo, so it's quite early in the workflow. The last part of the sentence was wrong: we need to checkout the repo first, otherwise we cannot access our own action (which is defined in our repo).