ci(tofu-plan): revive a workflow that has been rejected before starting since 2026-06-23 - #1097
Open
mdheller wants to merge 1 commit into
Open
ci(tofu-plan): revive a workflow that has been rejected before starting since 2026-06-23#1097mdheller wants to merge 1 commit into
mdheller wants to merge 1 commit into
Conversation
tofu-plan.yml has produced nothing but `startup_failure` since 2026-06-23. It last succeeded on 2026-06-10; 25 of its last 33 runs never started. The cause is not in the workflow's logic. This repo sets `allowed_actions: selected` with github_owned + verified-Marketplace + the patterns dtolnay/*, Swatinem/*, oven-sh/*, tauri-apps/*. `opentofu/setup-opentofu` is none of those — it is not listed on the Marketplace at all, so `verified_allowed` cannot reach it. GitHub rejects the run at creation, which is why the conclusion is `startup_failure` and why nothing in the logs points anywhere. Replaces both setup-opentofu steps with scripts/ci/install-opentofu.sh, the pinned checksum-verifying installer. It honours TOFU_VERSION, which this workflow already sets to 1.8.3, and carries that version's sha256. Also adds this workflow and the installer to its own `paths:` filter. The filter was `infra/tofu/**` only, so no PR that touched the workflow could ever run it — five weeks of silence had no surface on which to show up. Refs #1090.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Revives the tofu-plan GitHub Actions workflow that has been failing at creation time due to the repo’s restricted allowed_actions policy, by removing the disallowed third-party action and ensuring workflow changes can trigger the workflow itself.
Changes:
- Replace
opentofu/setup-opentofu@v1with an in-repo checksum-verifying installer script. - Expand
pathsfilters so changes to the workflow and installer script triggertofu-plan.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
scripts/ci/install-opentofu.sh |
Adds a pinned, checksum-verified OpenTofu installer to avoid disallowed third-party actions. |
.github/workflows/tofu-plan.yml |
Replaces the disallowed setup action with the script and updates paths filters to make the workflow self-testing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+44
to
+55
| DEST="${TOFU_INSTALL_DIR:-/usr/local/bin}" | ||
| TMP="$(mktemp -d)" | ||
| trap 'rm -rf "$TMP"' EXIT | ||
|
|
||
| echo "Downloading ${URL}" | ||
| curl -fsSL --retry 3 --retry-delay 2 -o "${TMP}/${ZIP}" "$URL" | ||
|
|
||
| echo "${SHA256} ${TMP}/${ZIP}" | sha256sum -c - | ||
|
|
||
| unzip -q -o "${TMP}/${ZIP}" tofu -d "$TMP" | ||
| install -m 0755 "${TMP}/tofu" "${DEST}/tofu" | ||
|
|
Comment on lines
+40
to
+41
| - name: Install OpenTofu | ||
| run: scripts/ci/install-opentofu.sh |
Comment on lines
+23
to
+32
| TOFU_VERSION="${TOFU_VERSION:-1.8.3}" | ||
| ARCH="$(uname -m)" | ||
| case "$ARCH" in | ||
| x86_64|amd64) GOARCH=amd64 ;; | ||
| aarch64|arm64) GOARCH=arm64 ;; | ||
| *) echo "::error::unsupported architecture ${ARCH}" >&2; exit 1 ;; | ||
| esac | ||
|
|
||
| # sha256 of tofu_<version>_linux_<arch>.zip, from the upstream SHA256SUMS. | ||
| case "${TOFU_VERSION}_${GOARCH}" in |
This was referenced Jul 30, 2026
Merged
fix(iac): make ibm-iks pass tofu validate — and stop it claiming OIDC federation IBM cannot do
#1107
Merged
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 was wrong
tofu-plan.ymlhas been 100% inert since 2026-06-23. Last success2026-06-10; every run from2026-06-23onward isstartup_failure.The workflow's logic is fine. The run is rejected at creation, before any job starts, so there are no logs and no annotation pointing at the cause — which is exactly why this sat quiet for five weeks.
This repo runs
allowed_actions: selected:{"github_owned_allowed":true,"verified_allowed":true, "patterns_allowed":["dtolnay/*","Swatinem/*","oven-sh/*","tauri-apps/*"]}opentofu/setup-opentofu(lines 26 and 95) is not github-owned, matches no pattern, and is not on the Marketplace at all —https://github.com/marketplace/actions/setup-opentofureturns 404, soverified_allowedcannot cover it. It is on none of the three permitted grounds.The fix
Both
opentofu/setup-opentofu@v1steps becomerun: scripts/ci/install-opentofu.sh— the pinned, checksum-verifying installer from #1090. It honoursTOFU_VERSION, which this workflow already sets to1.8.3(line 17), and already carries that version's sha256 for linux amd64/arm64.Downloading a release archive and checking it against a committed sha256 is strictly stronger than the action was: the checksum is reviewed in-tree, and no third-party code gets the workflow token.
After this change every
uses:left intofu-plan.ymlisactions/*(github-owned) plusgoogle-github-actions/auth@v2, which is empirically fine —provision-secrets.ymluses it and succeeded as recently as 2026-07-29.Why not just allowlist
opentofu/*An admin could add
opentofu/*topatterns_allowed. That was considered and rejected: it is a settings change rather than a code change, it cannot be reviewed in a diff, and the installer removes the third-party dependency entirely. This is the same call the drift lane made in #1090; the two lanes should not diverge on it.Cherry-pick, not a merge — and the divergence risk
#1090 has not merged. At the time of writing it is
OPEN/BLOCKEDwith every checkQUEUED(~400 jobs deep, no self-hosted runners), so waiting was not practical.scripts/ci/install-opentofu.shhere is byte-identical to #1090's copy:This means the file will exist on two branches until one lands. Whichever merges second will conflict on an identical add, or silently drift if either copy is edited in the meantime. Please do not edit it in only one place. Merging #1090 first and rebasing this PR is the cleanest order, but either order works as long as the file stays identical.
Also: the workflow could not test itself
The
paths:filter wasinfra/tofu/**only. No PR that touchedtofu-plan.ymlcould ever runtofu-plan.yml— which is a large part of why five weeks ofstartup_failurehad no surface on which to become visible.This adds
.github/workflows/tofu-plan.ymlandscripts/ci/install-opentofu.shto the filter, mirroring what #1090 did forinfra-drift-detect.yml. It also makes this PR self-verifying: the presence of atofu-planrun on this PR that is notstartup_failureis the proof the fix works.tools/check_workflow_path_filters.pyreports 0 failures and the same 130 pre-existing advisory gaps before and after — this adds no new path-filter debt, and the new installer step is covered by the added glob.First execution anywhere
Worth a reviewer's eye: #1090 never actually executes this script. Its cloud lanes are all
if: github.event_name != 'pull_request', and its self-test covers exit-code mapping, not installation. Thefmt-and-validatejob here is therefore the first real run ofinstall-opentofu.shanywhere.Specifically unproven until this PR's run goes green: the script does
install -m 0755 … /usr/local/bin/tofuwithoutsudo, and there is no other precedent in this repo for writing to/usr/local/binin CI. If that turns out to needsudoonubuntu-latest, it affects both lanes and should be fixed once, in the shared script.This is not the only workflow this happened to
Auditing all 109 registered workflows against their run history, four are blocked by this same policy, not one:
startup_failuretofu-plan.ymlopentofu/setup-opentofuinfra-drift-detect.ymlopentofu/setup-opentofu(fixed by #1090)helm-release.ymlhelm/chart-releaser-action@v1.6.0search-orchestrator-image-pin.ymlpeter-evans/create-pull-request@v6helm-release.ymlhas never had a successful run — it was born broken on 2026-06-23, the same daytofu-plan.ymldied, which is when this policy appears to have been applied.Both remaining blockers are isolated by elimination: every other action in those two workflows is proven to run today in a sibling workflow that succeeds (
azure/setup-helm@v4indeploy-tests.yml,google-github-actions/auth@v2inprovision-secrets.yml,actions/*throughout).Out of scope for this PR — filed as findings, not fixed here, to keep this change to the one workflow.
Does anything depend on
tofu-plan?No. The only required status check on
mainisdiagnostics-gate(rulesetmain-required-checks); the other active ruleset is Copilot review.tofu-plangates no merge and blocks no deploy — it is plan-only, and the file's own header notes no apply gate exists yet.So this was untidy rather than a hole.
infra-drift-detect.ymlis the one that matters: it is the scheduled lane that is supposed to notice infrastructure drift, and it has never once run.Reviving the workflow immediately catches real breakage that the blackout was hiding. Reproduced locally with OpenTofu against
origin/main, touching no.tffile in this PR:Plus two files that are merely unformatted:
All three arrived in the same commit —
c5bc4cfe("feat(model-zoo+iac): …", #674), merged 2026-07-03. That is ten days after this workflow went dark on 2026-06-23. It merged through a guard that was already silently rejected at startup, and nothing has looked atinfra/tofu/since — ten commits landed there in that window.infra/tofu/envs/gcp-landing/main.tfline 215 is not a style nit: it is invalid HCL that does not parse. It has been onmainfor four weeks.Deliberately not fixed here
This PR is scoped to
tofu-plan.ymlplus the cherry-picked installer, andinfra/tofu/is an active lane. The.tffixes are filed as a separate follow-up. The one-line fix is:and the other two are
tofu fmt -w.Sequencing: the
.tffix should land first, or be merged together with this PR. Either order is fine — but until it lands,fmt-and-validateis red for a genuine reason and this PR should not be force-merged past it.Depth of rot is still unknown
fmt checkis the first step infmt-and-validate. Because it exits non-zero, the fourtofu init -backend=false && tofu validatesteps (local, gcp-landing, shared, prod) never execute. Whatever those would have caught across seven weeks is still unmeasured — this PR proves the gate runs again, not that what is behind the gate is clean.