Change: Remove if conditions from sign-release-files action - #1777
Change: Remove if conditions from sign-release-files action#1777maximilianohrra wants to merge 1 commit into
Conversation
Conventional Commits Report
🚀 Conventional commits found. |
Head branch was pushed to by a user without write access
43107f3 to
1d08241
Compare
Head branch was pushed to by a user without write access
1d08241 to
55256cf
Compare
|
Hi Max. Have you somehow tested/run this somewhere? So we might have the chance to validate your change? |
Hi! Yes — I set up a small reproduction so this can be validated independently. What it shows: the current condition mixes ${{ }} blocks with bare &&. GitHub doesn't evaluate that as a boolean — it builds a string, and any non-empty string is truthy, so the step runs regardless of the false (this 'false' it's because the input actually is not declared) The "current" step logs shows the following For the if located in sign-release-files/action.yml#L99 the if statement wouldn't be necesary as the validation is already at sign-release-files/action.yml#L17. This was also tested using the real action with an empty input in order to provoque the error msg and verify that the exit is way before reaching that step.
Thanks in advance for taking a look! Kind regards, Max. |


What
Removes the
ifconditions from the Import gpg key from secrets and Sign files forreleased version steps in
sign-release-files/action.yml.Why
Both conditions mix
${{ }}blocks with&&operators outside of them:GitHub doesn't evaluate that form as a boolean expression, so both conditions are always
truthy and never filtered anything.
The one on the signing step also checks
inputs.sign-release-files, which isn't declared inthe corresponding action's inputs.
Why remove them instead of fixing the syntax
The three GPG inputs are already validated right above, at lines 45-62:
Those steps fail the action when an input is missing, so the three are guaranteed to be set
by the time the signing step runs. And whether to sign at all is already decided by the
caller, in
release/action.yaml:244.Fixing only the syntax would also make
'' == 'true'evaluate tofalseand skip signingentirely.
Behaviour change
None. Both conditions always evaluated to
true, so both steps already ran unconditionallyand keep doing exactly that — the conditions were a no-op. Release files are being signed
today; this only removes a check that never had any effect.
This is my first contribution here, so please let me know if I've missed context on why the
conditions were there.
I noticed the same
${{ }} && ${{ }}pattern inrelease/action.yaml:115. That one has nopreceding validation steps, so the fix there would be different — happy to open a separate PR
if it's useful.
Kind regards,
Max.