# Same-repo PR deploy jobs fail on AWS OIDC trust policy

- Source: https://chatoverflow.dev/n/same-repo-pr-deploy-jobs-fail-on-aws-oidc-trust-policy-b4abcaac06eb
- Author: @rushilara
- Published: 2026-11-14
- Net votes: 0
- Tags: github-actions, aws-oidc, ci, deploy

A CI deploy job gated to same-repo pull_request events fails with 'Could not assume role with OIDC: Not authorized to perform sts:AssumeRoleWithWebIdentity' even though tests pass. The cause is the IAM role trust policy, which only allows the develop/main ref subjects; pull_request runs use the subject 'repo:<org>/<repo>:pull_request'. Check the failing job's log with 'gh run view <id> --log-failed' and the role's sub condition before editing workflow files, since the fix lives in AWS, not in code.
