Skip to content

fix(ci): add missing octo-sts policy for license check#7664

Merged
BridgeAR merged 1 commit intomasterfrom
watson/fix-workflow
Mar 5, 2026
Merged

fix(ci): add missing octo-sts policy for license check#7664
BridgeAR merged 1 commit intomasterfrom
watson/fix-workflow

Conversation

@watson
Copy link
Copy Markdown
Collaborator

@watson watson commented Mar 4, 2026

What does this PR do?

Fixes the update-3rdparty-licenses CI workflow, which has been broken on every bot PR since commit 4afd74a (Feb 5) introduced an octo-sts step without the corresponding chainguard policy.

Two changes:

  1. Adds the missing update-3rdparty-licenses octo-sts policy (.github/chainguard/update-3rdparty-licenses.sts.yaml) — restricts token minting to dependabot[bot] and dd-octo-sts[bot] actors, and pins to this specific workflow file.

  2. Splits the workflow into two jobs for privilege separation — the check-licenses job processes untrusted PR code with read-only permissions (contents: read), while the auto-commit-licenses job holds id-token: write but only runs for bot PRs and never executes third-party code. This follows the same pattern as dependabot-automation.yml (vendor-build / vendor-push).

Motivation

The update-3rdparty-licenses workflow was failing at the "Mint GitHub App token (octo-sts)" step with "Fetch failed after 4 attempts" because the policy file was never created. Human PRs were unaffected since the octo-sts step was skipped via an if condition.

Beyond just fixing the missing policy, the original single-job design granted id-token: write to the entire job — including steps that check out and process untrusted PR code (e.g., running dd-license-attribution on the PR's yarn.lock). Splitting into two jobs ensures the OIDC token is never available in the same job that handles untrusted input.

Additional Notes

  • The check-licenses job behavior is unchanged for human PRs: it still fails with instructions when LICENSE-3rdparty.csv is out of date.
  • The head_oid needed for the GraphQL commit mutation is passed as a job output from check-licenses, avoiding a checkout in the privileged job.
  • The expectedHeadOid field in the mutation protects against race conditions between the two jobs.

The update-3rdparty-licenses workflow has been failing on
every bot PR since the octo-sts step was introduced (4afd74a)
because the corresponding chainguard policy was never created.

Split the workflow into two jobs for privilege separation:
the license check runs with read-only permissions, while
the auto-commit job (id-token: write) only runs for bot PRs
and never processes untrusted code.
Copy link
Copy Markdown
Collaborator Author

watson commented Mar 4, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

Overall package size

Self size: 4.89 MB
Deduped: 5.74 MB
No deduping: 5.74 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 816.75 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@watson watson self-assigned this Mar 4, 2026
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 4, 2026

Benchmarks

Benchmark execution time: 2026-03-04 10:59:55

Comparing candidate commit 24a5ce2 in PR branch watson/fix-workflow with baseline commit 0a08693 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 229 metrics, 31 unstable metrics.

@watson watson force-pushed the watson/fix-workflow branch from 524a5e0 to 24a5ce2 Compare March 4, 2026 10:51
@datadog-official
Copy link
Copy Markdown

datadog-official bot commented Mar 4, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 24a5ce2 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@watson watson marked this pull request as ready for review March 4, 2026 11:06
@watson watson requested review from a team March 4, 2026 11:31
@gh-worker-ownership-write-b05516 gh-worker-ownership-write-b05516 bot removed the request for review from a team March 5, 2026 10:14
@BridgeAR BridgeAR merged commit 00a41c5 into master Mar 5, 2026
846 of 1397 checks passed
@BridgeAR BridgeAR deleted the watson/fix-workflow branch March 5, 2026 10:14
dd-octo-sts bot pushed a commit that referenced this pull request Mar 5, 2026
The update-3rdparty-licenses workflow has been failing on
every bot PR since the octo-sts step was introduced (4afd74a)
because the corresponding chainguard policy was never created.

Split the workflow into two jobs for privilege separation:
the license check runs with read-only permissions, while
the auto-commit job (id-token: write) only runs for bot PRs
and never processes untrusted code.
@dd-octo-sts dd-octo-sts bot mentioned this pull request Mar 5, 2026
juan-fernandez pushed a commit that referenced this pull request Mar 5, 2026
The update-3rdparty-licenses workflow has been failing on
every bot PR since the octo-sts step was introduced (4afd74a)
because the corresponding chainguard policy was never created.

Split the workflow into two jobs for privilege separation:
the license check runs with read-only permissions, while
the auto-commit job (id-token: write) only runs for bot PRs
and never processes untrusted code.
crysmags pushed a commit that referenced this pull request Mar 6, 2026
The update-3rdparty-licenses workflow has been failing on
every bot PR since the octo-sts step was introduced (4afd74a)
because the corresponding chainguard policy was never created.

Split the workflow into two jobs for privilege separation:
the license check runs with read-only permissions, while
the auto-commit job (id-token: write) only runs for bot PRs
and never processes untrusted code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants