Skip to content

fix: v1.1.2 unparseable — secrets context does not exist in step if - #4

Open
tmihalicka wants to merge 2 commits into
mainfrom
fix/secrets-context-in-if
Open

tmihalicka wants to merge 2 commits into
mainfrom
fix/secrets-context-in-if

Conversation

@tmihalicka

Copy link
Copy Markdown
Member

Problem

build.yml@v1.1.2 (and current main) cannot be parsed by GitHub Actions: step-level if: has no secrets context, so every caller fails with:

Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.SCW_ACCESS_KEY == ''

The caller sees this as a run with zero jobs (what jednoduchopis-crm run 38396125618 hit). The 1Password bypass from #3 never executed at all — the earlier "missing tag" diagnosis was only the first layer.

Fix

  • build/publish jobs: job-level env: DIRECT_REGISTRY_CREDS: ${{ secrets.SCW_ACCESS_KEY != '' }} (job env does get secrets); the three bypass-related steps branch on env.DIRECT_REGISTRY_CREDS instead.
  • writeback job: drop the preflight skip entirely — the GitHub App key still loads from 1Password unconditionally, so skipping the OP-token preflight when the registry bypass is armed would just move the failure somewhere cryptic.
  • Fix an unterminated quote in the bypass step's echo (would have failed at runtime once reachable).

actionlint passes.

After merge

Needs a signed v1.1.3 tag (owner-created, same as v1.1.2); callers on v1.1.2 must bump — jednoduchopis-crm will be pinned to the merge SHA in the meantime to unblock the prod deploy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LsMgGVLnvZHf9LLjBW4eae

tmihalicka and others added 2 commits October 13, 2026 14:32
GitHub refuses to parse a workflow whose step `if:` references the
`secrets` context ("Unrecognized named-value: 'secrets'"), so every
caller of build.yml@v1.1.2 fails with a zero-job run before anything
executes. The bypass shipped in #3 therefore never ran at all.

- build/publish: job-level `env.DIRECT_REGISTRY_CREDS` computes the
  presence test once (job env does get `secrets`); steps branch on it.
- writeback: the preflight skip was wrong anyway — the GitHub App key
  still comes from 1Password unconditionally, so the OP token preflight
  now always runs.
- fix an unterminated quote in the bypass step's echo that would have
  failed the step at runtime.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsMgGVLnvZHf9LLjBW4eae
…w twice

actionlint flags the exact defect v1.1.2 shipped with ("context 'secrets'
is not allowed here"), and this repo had no CI to run it. Toolchain comes
from `go run <module>@<version>`, pinned and verified against the Go
checksum database rather than trusting a third-party action.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsMgGVLnvZHf9LLjBW4eae
@tmihalicka

Copy link
Copy Markdown
Member Author

Added an actionlint CI job to this PR — it catches exactly the secrets-in-if defect that shipped in v1.1.2 (context "secrets" is not allowed here), and this repo previously had no CI at all. Verified locally: actionlint 1.7.12 passes on the fixed build.yml and fails on v1.1.2.

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.

1 participant