Skip to content

ci: GHA workflow security cleanup - #451

Merged
emptyhammond merged 5 commits into
mainfrom
worktree-fixup-workflows
Jun 29, 2026
Merged

ci: GHA workflow security cleanup#451
emptyhammond merged 5 commits into
mainfrom
worktree-fixup-workflows

Conversation

@emptyhammond

Copy link
Copy Markdown
Contributor

Routine hygiene pass over the GitHub Actions workflows in this repo, addressing findings from a workflow security audit. Changes are split into five commits, one per finding type:

  • Disable credential persistence on actions/checkout steps so the workflow's GITHUB_TOKEN is not left in the local git config after checkout.
  • Scope each job's permissions explicitly: top-level permissions: {}, with each job granted only the GITHUB_TOKEN scopes it actually needs.
  • Move the workflow-context expansion (${{ matrix.type }}) out of run: shell source and read it from the already-defined TEST_TYPE env binding instead.
  • Pin all third-party actions to commit SHAs (with the tag preserved as a comment) so an upstream tag move can't silently change what runs in CI.
  • Replace secrets: inherit on the reusable ably/features workflow call with an explicit passthrough of the single secret it declares (ABLY_AWS_ACCOUNT_ID_SDK), so unrelated repo secrets aren't forwarded into it.

No behavioural changes intended — the workflows run the same checks against the same inputs.

actions/checkout leaves the workflow's GITHUB_TOKEN in the local git
config after fetching by default. Set persist-credentials: false so
later steps don't inherit token access they don't need.
Set a top-level permissions: {} default and grant each job only the
GITHUB_TOKEN scopes it needs:
- check.yml/check and check.yml/finish: contents: read for checkout
and coverallsapp PR identification.
- features.yml/build: contents, deployments, id-token to match the
permissions the called reusable workflow requires.
The run: block expanded ${{ matrix.type }} into the shell directly.
Reference TEST_TYPE (already bound in the step's env:) instead so
workflow-context values stay out of the shell source.
Tags can be moved to point at different commits after publication.
Pinning the SHA (with the previous tag retained as a comment for
readability) ensures CI runs the exact code we audited.
The called workflow only declares ABLY_AWS_ACCOUNT_ID_SDK in its
workflow_call.secrets contract. Replace secrets: inherit with an
explicit passthrough so other repo secrets aren't forwarded into a
workflow that has no need for them.
@lawrence-forooghian

Copy link
Copy Markdown
Contributor

@emptyhammond looks like this has broken something in CI

@github-actions
github-actionsBottemporarily deployed to staging/pull/451/features June 25, 2026 21:46 Inactive
@github-actions
github-actionsBottemporarily deployed to staging/pull/451/docs June 25, 2026 21:47 Inactive
@github-actions
github-actionsBottemporarily deployed to staging/pull/451/features June 25, 2026 22:42 Inactive
@github-actions
github-actionsBottemporarily deployed to staging/pull/451/docs June 25, 2026 22:42 Inactive
@emptyhammond

Copy link
Copy Markdown
ContributorAuthor

@emptyhammond looks like this has broken something in CI

@lawrence-forooghian the failures seem to be related to presence acceptance tests - not the workflow changes.

@emptyhammond
emptyhammond merged commit 39dcc1c into mainJun 29, 2026
32 of 90 checks passed
@emptyhammond
emptyhammond deleted the worktree-fixup-workflows branch June 29, 2026 10:42
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@emptyhammond@lawrence-forooghian