Teach the OIDC subject format that GitHub now sends - #233
Merged
Merged
Conversation
The role wizard builds the subject claim from names alone. GitHub adds immutable account and repository IDs for anything created after July 15, 2026, so the deploy fails with "Not authorized to perform sts:AssumeRoleWithWebIdentity". Students now set the subject with both IDs, under StringLike, since StringEquals treats the trailing wildcard as a literal character.
The policy here matched on names, which no longer works for forks created after July 15, 2026. The new subject ends with a wildcard, so it also covers the environment:production claim this page adds, and the separate environment entry is gone.
This step replaced the whole subject condition with name-only entries, which would have undone the IDs set in the S3 deployment instruction. It now extends the StringLike condition with both repositories.
The section applied only to renamed accounts, but every fork created after July 15, 2026 carries the ID subject. It now also covers roles created before the S3 instruction taught it, reads both IDs from one API page, and puts the subject under StringLike. The example also had two typos, "re:refs/heads" and "refs/head/main".
leesjensen
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every fork created this semester will fail to assume the AWS role, because GitHub changed the OIDC subject claim and the course still teaches the old one. I reproduced it end to end in my own AWS account and confirmed the fix.
The test ran one workflow on one branch - only the trust policy changed between the two runs.
Phase 1, the policy the course produces today, names only:
Phase 2, same workflow, same branch, subject switched to the format in this PR:
GitHub applies this to every repository created after July 15, 2026, and to any account or repository renamed after that date. That makes it the whole class this semester rather than an edge case:
https://github.blog/changelog/2026-04-23-immutable-subject-claims-for-github-actions-oidc-tokens/
Any student can read their own subject with this, which is also how they get the two IDs:
What changed:
re:refs/headsandrefs/head/main, that fail on a copy and paste.Two details worth a look:
StringLikerather thanStringEquals, becauseStringEqualstreats the trailing wildcard as a literal character and silently never matches.environment:productionentry is no longer needed and deliverable 7 no longer has to rewrite the array.If you'd rather pin each case exactly instead of using a wildcard, say so and I'll rewrite it that way.