Skip to content

fix: avoid secrets context in pub publish step conditions - #542

Merged
erickzanardo merged 1 commit into
mainfrom
fix/secrets-in-step-if
Oct 28, 2026
Merged

erickzanardo merged 1 commit into
mainfrom
fix/secrets-in-step-if

Conversation

@erickzanardo

Copy link
Copy Markdown
Member

Description

dart_pub_publish.yml and flutter_pub_publish.yml failed workflow validation on every push (0s runs, "workflow file issue"). Every recorded run since 2025-09-04 has failed. The cause is step-level if: conditions that reference secrets.pub_credentials. GitHub doesn't make the secrets context available there.

Changes

  • Map secrets.pub_credentials to a job-level PUB_CREDENTIALS env var and check env.PUB_CREDENTIALS in the step conditions. It has to be job-level because a step's if: is evaluated before that step's own env:.
  • Write the credentials file from "$PUB_CREDENTIALS" instead of putting ${{ secrets.pub_credentials }} into the script, which avoids shell-quoting/injection issues with the JSON.
  • Add a structural test that fails if any template uses secrets. in a step if:. I confirmed it fails against the previous versions of both files.

Type of Change

  • 🛠️ Bug fix (non-breaking change which fixes an issue)

🤖 Generated with Claude Code

GitHub does not expose the `secrets` context to step-level `if:`
conditions, so dart_pub_publish.yml and flutter_pub_publish.yml failed
workflow validation on every push. Map `pub_credentials` to a job-level
`PUB_CREDENTIALS` env var and check that instead. The credentials are
also now written via the env var rather than interpolated into the
script.

Adds a structural test that rejects `secrets.` in step conditions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@erickzanardo
erickzanardo requested a review from a team as a code owner October 28, 2026 14:54
@erickzanardo erickzanardo changed the title fix(pub_publish): avoid secrets context in step conditions fix: avoid secrets context in pub publish step conditions Oct 28, 2026
@erickzanardo
erickzanardo merged commit 633bd65 into main Oct 28, 2026
33 of 34 checks passed
@erickzanardo
erickzanardo deleted the fix/secrets-in-step-if branch October 28, 2026 16:42
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in VGV Open Source 🦄 🧙🌟 Oct 28, 2026
@vgvbot vgvbot mentioned this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants