Merged
Conversation
- Add configure-aws composite action supporting both OIDC and static credentials
- Update build.yml workflow with optional AWS authentication and extra-env input
- Update release.yml to use configure-aws action and support OIDC
- OIDC is the recommended approach (no long-lived credentials)
Usage in build.yml:
uses: redis/github-workflows/.github/workflows/build.yml@main
with:
aws-role-arn: arn:aws:iam::ACCOUNT:role/GitHubActions
aws-region: us-west-1
extra-env: '{"S3_TEST_BUCKET": "my-bucket"}'
AWS IAM setup required:
1. Create OIDC identity provider for token.actions.githubusercontent.com
2. Create IAM role with trust policy for your repository
3. Attach required permissions (e.g., S3 access) to the role
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
Add support for AWS OIDC (OpenID Connect) authentication in reusable workflows. OIDC is the recommended approach as it eliminates the need for long-lived AWS credentials stored as secrets.
Changes
New Composite Action:
configure-awsA reusable action that configures AWS credentials using either:
Updated Workflows
build.yml:aws-role-arninput for OIDC authenticationaws-regioninputextra-envinput for passing arbitrary environment variables as JSONaws-access-key-idandaws-secret-access-keysecrets (fallback)id-token: writepermission for OIDCrelease.yml:aws-role-arnandaws-regioninputsconfigure-awscomposite action (removes code duplication)id-token: writepermission for OIDCUsage Example
AWS Setup Required
Create OIDC Identity Provider in AWS IAM:
https://token.actions.githubusercontent.comsts.amazonaws.comCreate IAM Role with trust policy:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::ACCOUNT:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" }, "StringLike": { "token.actions.githubusercontent.com:sub": "repo:ORG/REPO:*" } } }] }Benefits of OIDC