Skip to content

fix(ci): hand each reusable workflow the secrets it reads - #860

Merged
TarikGul merged 4 commits into
mainfrom
tg/explicit-workflow-secrets
Sep 21, 2026
Merged

TarikGul merged 4 commits into
mainfrom
tg/explicit-workflow-secrets

Conversation

@TarikGul

@TarikGul TarikGul commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

secrets: inherit passes every secret this repository holds, so a workflow that reads three of them received all eighteen, including the App Store Connect key, the Match passphrase and the Firebase service account. The prepare pipeline reads none at all and received the same eighteen.

Each reusable workflow now declares what it reads, and each caller passes exactly that. The prepare pipeline is handed nothing. Eight of the fourteen are required; the six that are tolerated empty or read only by the Safetynet configuration are optional, which is also true of five of them that are not set on this repository at all.

This matters most for ios-release-distribution.yml, which triggers on pull_request. Under inherit that build could reach FASTLANE_RW_PAT, which has write access to the signing repository, along with CREDENTIAL_FILE_CONTENT, SIGNER_BOT_SVC_TOKEN and the publishing credentials. It needs none of them and can no longer see any of them.

It also pins the four actions in the iOS install composite. That step writes a credential for the signing repository into the job environment, and every later step inherits it, so two of them were resolving third-party code from a moving reference, one of which is a branch rather than a tag.

Part of #791. Still outstanding there: a dormant secrets: inherit with a mutable reference in the vendored Android tree, which would reopen this the moment those workflows are re-homed, and around thirty unpinned first-party action references across the iOS workflows.

secrets: inherit passes every secret this repository holds, so a workflow
that reads three of them received all eighteen, including the App Store
Connect key, the Match passphrase and the Firebase service account. The
prepare pipeline reads none at all and received the same eighteen.

Each reusable workflow now declares what it reads and each caller passes
exactly that. The prepare pipeline is handed nothing.

The declaration is also the check: a secret added to a callee without being
declared fails at the call rather than resolving to an empty string, which
is the shape this class of bug usually takes.
@TarikGul
TarikGul requested a review from a team September 20, 2026 19:13
@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

CI Status: 20 required jobs green, 14 passed and 6 skipped by path filter.

All job results
job result
android-bindings skipped
changes success
changeset-guard skipped
cli-package skipped
codegen success
e2e skipped
explorer success
host-android-bindings success
ios-bindings success
ios-swift skipped
licenses success
playground success
provider-android-bindings skipped
release-guard success
rust success
ts-client success
ts-debugger success
ts-host success
wasm-provider success
workflow-lint success

Commit d029ec46 · run log

The install composite writes a git credential for the signing repository into
GITHUB_ENV, and every later step in the job inherits it. Two of those steps
resolved third-party code from a moving reference, one of them a branch
rather than a tag, so whatever that reference pointed at when the job ran
could read the credential out of the environment. All four are now pinned to
a commit.

Marks as optional the six secrets that are tolerated empty or read only by
the Safetynet configuration. Five of them are not set on this repository at
all, so declaring them required described something that was not true.

Corrects the note that told the next reader reusable workflows need
secrets: inherit, which now contradicts the workflows themselves.
@github-actions github-actions Bot added the host-work Needs implementation in one or more host repos label Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

iOS simulator preview

Built from d029ec468, stamped with it in TrUAPICommit.

gh run download 35534170644 --name simulator-preview-d029ec468
unzip polkadot-app-*.app.zip
xcrun simctl install booted polkadot-app.app
xcrun simctl launch booted io.parity.polkadotapp.develop

Or download it in a browser, which arrives as a zip wrapping
the .app.zip, so it needs unzipping twice.

An arm64 simulator slice, so it needs an Apple Silicon Mac and does not
install on a device. Kept for 14 days, after which the link stops
resolving and a new push rebuilds it.

The re-homed iOS copy of this workflow is pinned and passes nothing; the
Android one still resolves a third-party reusable workflow from a tag that
can move and hands it every secret this repository holds. It is dormant,
because only the root of the repository is read for workflows, but it is
the original shape of the problem waiting for those workflows to be
re-homed.

@filvecchiato filvecchiato left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question

Comment thread .github/workflows/ios-nightly-distribution.yml
@TarikGul
TarikGul added this pull request to the merge queue Sep 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 21, 2026
@TarikGul
TarikGul added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit 5e29832 Sep 21, 2026
34 checks passed
@TarikGul
TarikGul deleted the tg/explicit-workflow-secrets branch September 21, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code host-work Needs implementation in one or more host repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants