Repair the Release workflow, and lint workflows in CI - #137
Merged
Conversation
#136 left `release.yml` unparseable: `secrets` is not among the contexts available to a step-level `if`, so GitHub rejected the whole file. The failure is quiet — the run reports "failure" with **zero jobs**, and the workflow list shows the file path instead of its name. Releases would have stopped working silently at the next changeset. Resolving the secret at job level fixes it: `secrets` *is* available in `jobs.<id>.env`, and `env` is available to a step `if`. Added actionlint to the `check` chain, verified against the exact bug: release.yml:45:17: context "secrets" is not allowed here. available contexts are "env", "github", "inputs", "job", "matrix", "needs", "runner", "steps", "strategy", "vars" A broken workflow file is the one class of CI failure the CI itself cannot report, which is what made this worth a gate of its own rather than more care.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What broke
#136 left
release.ymlunparseable. Thesecretscontext is not among those available to a step-levelif, so GitHub rejected the entire file:My fault: the first draft used
vars.RELEASE_APP_ENABLED(valid) and I "simplified" it to read the secret directly, without checking the context availability table.Why it went unnoticed
This failure mode is unusually quiet:
failurewith zero jobs — nothing to open, no logs,--log-failedreturns "log not found".github/workflows/release.ymlinstead ofReleaseNothing else changes. Releases would simply have stopped working at the next changeset, and the reason would not have been obvious.
The fix
secretsis available injobs.<id>.env, andenvis available to a stepif. So the check moves up one level:Same behaviour as intended in #136, including the
GITHUB_TOKENfallback.The gate
Added
actionlintas aworkflowsjob, and put it indocker'sneedsalongside the others.Verified it catches this exact bug: run against the broken file it reports the error above; against the fixed one it exits clean. A workflow that fails to parse is the one class of CI failure the CI cannot report on its own, so it is worth a check rather than more care.
Note: the App is already installed and
APP_ID/APP_PRIVATE_KEYare set, so once this merges the release path uses the App. The next "Version Packages" PR should carry the full check suite and be authored by the App instead ofgithub-actions[bot]— that is the confirmation to look for.