fix(aws-credentials): default the OIDC audience to sts.amazonaws.com - #40
Merged
Conversation
Every OIDC role assumption through this wrapper failed with "Could not assume
role with OIDC: The web identity token provided could not be validated."
The wrapped action declares `audience` with `default: sts.amazonaws.com`, but a
GitHub Actions input default applies only when the input is absent, never when
it is present and empty. Forwarding `${{ inputs.audience }}` with a local
default of '' therefore passed an explicit empty string and clobbered it, so
GitHub minted the token with aud=https://github.com/<owner> and STS rejected it.
Sets the local default to sts.amazonaws.com and coalesces at the call site, so a
caller that forwards its own empty-defaulted input cannot reintroduce this.
role-session-name and role-duration-seconds are deliberately left alone: the
wrapped action declares no action.yml default for either, so their empty strings
fall through to its internal defaults rather than overriding anything. Pinning
values here would change behaviour instead of restoring it.
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.
Summary
aws-credentialswrapper fails withCould not assume role with OIDC: The web identity token provided could not be validated.aws-actions/configure-aws-credentialsdeclaresaudiencewithdefault: sts.amazonaws.com, but a GitHub Actions input default applies only when the input is absent, never when it is present and empty. Forwarding${{ inputs.audience }}with a local default of''passed an explicit empty string and clobbered that default, so GitHub minted the token withaud=https://github.com/<owner>and STS rejected it.sts.amazonaws.com, and coalesces at the call site so a caller forwarding its own empty-defaulted input cannot reintroduce it.docs/actions/aws-credentials.md.Why the other empty passthroughs are left alone
role-session-nameandrole-duration-secondslook like the same bug but aren't: the wrapped action declares noaction.ymldefault for either, so their empty strings fall through to its internal defaults (GitHubActions, one hour). Pinning values here would change behavior rather than restore it. Onlyaudiencehas a declared default to clobber.Blast radius
.github/workflows/cloudflare-pages-deploy.ymlis the only consumer in this repo and it doesn't passaudience, so the declared default alone is sufficient. Any repo calling the composite directly for OIDC was hitting this.Verification
action.ymland the docs parse cleanlydomengabrovsek/gabrovsek-devrun 31489563658 failed on exactly this:setup-node-npmand the build passed,Configure AWS credentialsfailed. Re-running it after this merges is the check that matters.