Skip to content

Change: Remove if conditions from sign-release-files action - #1777

Open
maximilianohrra wants to merge 1 commit into
greenbone:mainfrom
maximilianohrra:fix/sign-release-files-signing-condition
Open

Change: Remove if conditions from sign-release-files action#1777
maximilianohrra wants to merge 1 commit into
greenbone:mainfrom
maximilianohrra:fix/sign-release-files-signing-condition

Conversation

@maximilianohrra

Copy link
Copy Markdown

What

Removes the if conditions from the Import gpg key from secrets and Sign files for
released version
steps in sign-release-files/action.yml.

Why

Both conditions mix ${{ }} blocks with && operators outside of them:

if: ${{ inputs.sign-release-files == 'true' }} && ${{ inputs.gpg-key }} && ...

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 in
the 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:

- name: Check gpg-key input
  if: inputs.gpg-key == ''
  run: |
    echo "::error ::gpg-key input is missing."
    exit 1

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 to false and skip signing
entirely.

Behaviour change

None. Both conditions always evaluated to true, so both steps already ran unconditionally
and 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 in release/action.yaml:115. That one has no
preceding validation steps, so the fix there would be different — happy to open a separate PR
if it's useful.

Kind regards,

Max.

@maximilianohrra
maximilianohrra requested a review from a team as a code owner July 27, 2026 19:27
@greenbonebot
greenbonebot enabled auto-merge (rebase) July 27, 2026 19:27
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Conventional Commits Report

Type Number
Bug Fixes 1

🚀 Conventional commits found.

auto-merge was automatically disabled July 27, 2026 19:36

Head branch was pushed to by a user without write access

@maximilianohrra
maximilianohrra force-pushed the fix/sign-release-files-signing-condition branch from 43107f3 to 1d08241 Compare July 27, 2026 19:36
@greenbonebot
greenbonebot enabled auto-merge (rebase) July 27, 2026 19:36
auto-merge was automatically disabled July 27, 2026 21:51

Head branch was pushed to by a user without write access

@maximilianohrra
maximilianohrra force-pushed the fix/sign-release-files-signing-condition branch from 1d08241 to 55256cf Compare July 27, 2026 21:51
@greenbonebot
greenbonebot enabled auto-merge (rebase) July 27, 2026 21:51
@y0urself

Copy link
Copy Markdown
Member

Hi Max. Have you somehow tested/run this somewhere? So we might have the chance to validate your change?

@maximilianohrra

maximilianohrra commented Jul 28, 2026

Copy link
Copy Markdown
Author

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.
I've created a 'Test if-condition' workflow, which calls to the corresponding check - action mirroring the original condition in the sign-release-files/action.yml

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
image

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.

image

Thanks in advance for taking a look!

Kind regards,

Max.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants