You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ci): address actionlint genuine findings surfaced by the new lint job
Six small, independent fixes for real issues that the newly-added
actionlint/shellcheck job flagged in pre-existing workflow files. None
of these are regressions from the recent refactor -- they've been
latent for a while. Grouped because they're all the same class of
work: "make lint pass green on meaningful findings."
* gcp-publish.yml: drop `default: ''` from the `version_major` and
`arch` `type: choice` inputs. An empty default isn't in either
options list, so actionlint 'events' rejects it; GitHub's UI already
pre-selects the first option regardless.
* gcp-test.yml (Determine image to test): replace
`elif [ "${{ inputs.arch == 'ALL' }}" ]; then` with
`elif [ "${{ inputs.arch }}" = "ALL" ]; then`. The original has the
GHA expression engine evaluate `arch == 'ALL'` to the literal string
'true' or 'false' before bash runs; bash's `[ "true" ]` and
`[ "false" ]` are both non-empty-string tests (i.e. always true), so
the elif always fired and the else branch was unreachable. No
production impact today (both arms computed the same image_path),
but it's a correctness trap waiting to bite a future edit.
* gcp-test.yml (Run Google cloud-image-testing tests): drop the
unreachable `${{ matrix.zone && format('-zone {0}', matrix.zone)
|| '' }}` line from the x86_64 per-shape job. That matrix only
declares `shape:` -- the `include:` block that would carry `zone:`
overrides is commented out (L218-222) with 'disabled, never any
capacity available'. `matrix.zone` evaluated to null and the
expression collapsed to an empty arg. The aarch64 matrix still
carries and uses `zone:` entries unchanged.
* azure-to-gallery.yml (Read the image info, Release the image to a
Gallery): bind the GHA expressions `${{ env.IMAGE_FILE }}`,
`${{ inputs.url_type }}`, `${{ inputs.dry-run-mode }}`,
`${{ inputs.public_gallery }}`, `${{ env.RELEASE_VERSION }}` to
local bash variables before using them in `[[ ... == ... ]]` and
`case $var in` tests. actionlint's shellcheck integration sees the
raw `${{ ... }}` template and trips SC2193 ('arguments can never
be equal'); binding to shell variables gives shellcheck a real
string to track and also eliminates a class of quoting/escaping
foot-guns.
* vagrant-publish.yml (Construct tag name): drop the unreachable
`continue` after `echo "[Error]..." && exit 1`. Dead code; `exit 1`
always runs.
* ami-to-marketplace.yml (Get corresponded Product ID): add a
scoped `# shellcheck disable=SC2195` with an explanatory comment.
shellcheck can't track the two-step parameter expansion
`${short_name% * *}` on the AMI `Name` field
(e.g. 'AlmaLinux OS 9.6.20240619 x86_64' -> 'AlmaLinux OS') and
mis-reports every case arm as 'pattern will never match the word.'
0 commit comments