Skip to content

docs: fix misleading claims.workflow example in policies.md#19

Merged
simpsonw merged 2 commits into
mainfrom
simpsonw.fix-workflow-claim-docs
Apr 13, 2026
Merged

docs: fix misleading claims.workflow example in policies.md#19
simpsonw merged 2 commits into
mainfrom
simpsonw.fix-workflow-claim-docs

Conversation

@simpsonw
Copy link
Copy Markdown
Member

Description

Replace the claims.workflow == "deploy.yml" CEL condition example in docs/policies.md with claims.workflow_ref, which is the correct claim for workflow pinning.

Context / Why are we making this change?

The workflow OIDC claim contains the workflow's name: field (e.g., "Deploy Production"), not the filename. This means claims.workflow == "deploy.yml" only works when the workflow YAML omits the name: field entirely — which is uncommon. Users copying this example will get a condition that silently fails to match.

claims.workflow_ref contains the full canonical path (e.g., my-org/my-repo/.github/workflows/deploy.yml@refs/heads/main) and is reliable for security pinning.

See: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context

Fixes #18

Testing and QA Plan

Documentation-only change. Verified that claims.workflow_ref is used in the production policy in etsy/github-app-sts-policies and that the CEL syntax is valid.

Impact

No code changes. Corrects a misleading example that could lead to overly permissive or non-functional policies.

The `workflow` OIDC claim contains the workflow's `name:` field (e.g.,
"Deploy Production"), not the filename. This means
`claims.workflow == "deploy.yml"` only works when the workflow omits
the `name:` field entirely.

Replace with `claims.workflow_ref` which contains the full canonical
path and is reliable for security pinning.

Fixes #18

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simpsonw simpsonw requested a review from a team as a code owner April 13, 2026 19:57
It doesn't really make sense to tell the user the wrong way to do things
@simpsonw simpsonw merged commit d2e09f3 into main Apr 13, 2026
2 checks passed
@simpsonw simpsonw deleted the simpsonw.fix-workflow-claim-docs branch April 13, 2026 20:31
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.

docs: misleading claims.workflow example in policies.md

2 participants