Correct expressions in GitHub Actions workflows #1952
Merged
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.
Fixes #1918
Proposed Changes
The expression syntax used by a number of workflows is incorrect.
If you use this syntax:
this will ALWAYS evaluate to true as the evaluation happens in the
${{..}}
part, and the part after the==
is ignored.You should instead evaluate the whole expression within the
${{..}}
parts:Or alternatively the
${{..}}
part is actually optional withinif:
statements so this works too:This means both parts of the stale job are run (the scheduled part which adds stale label to issue, and also removes it necessary), and the second part (which removes the stale label from the commented on issue only). This means the stale label is attempted to be removed twice, hence why the job fails and you get the email.
I originally noticed this for the stale job after raising #1918 but it actually is wrong in other workflows too, meaning:
Readiness Checklist
Author/Contributor
No change to documentation required.
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance