mirror of
https://github.com/docker/build-push-action.git
synced 2026-05-30 09:58:19 +01:00
feat(e2e): replace AWS_ACCESS_KEY_ID secrets with OIDC role assumption
Adds aws-role-to-assume input to .e2e-run.yml. Adds configure-aws-credentials step (pinned SHA, with role-session-name) before the Login to Registry step, conditioned on ECR registry detection. Updates e2e.yml to pass the OIDC role ARN and remove AWS secrets from the matrix credential expressions. Role: arn:aws:iam::175142243308:role/official_gha_cicd Action: aws-actions/configure-aws-credentials@7474bc4690 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
15
.github/workflows/.e2e-run.yml
vendored
15
.github/workflows/.e2e-run.yml
vendored
@@ -22,6 +22,10 @@ on:
|
||||
slug:
|
||||
required: false
|
||||
type: string
|
||||
aws-role-to-assume:
|
||||
required: false
|
||||
type: string
|
||||
description: "IAM role ARN to assume via OIDC for ECR authentication. When set, configure-aws-credentials runs before registry login."
|
||||
secrets:
|
||||
registry_username:
|
||||
required: false
|
||||
@@ -36,6 +40,9 @@ env:
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -111,6 +118,14 @@ jobs:
|
||||
driver-opts: |
|
||||
image=${{ matrix.buildkit_image }}
|
||||
network=host
|
||||
-
|
||||
name: Configure AWS credentials
|
||||
if: inputs.aws-role-to-assume != '' && (contains(inputs.registry, '.ecr.') || inputs.registry == 'public.ecr.aws')
|
||||
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
|
||||
with:
|
||||
role-to-assume: ${{ inputs.aws-role-to-assume }}
|
||||
aws-region: us-east-1
|
||||
role-session-name: gha-build-push-action-e2e-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
-
|
||||
name: Login to Registry
|
||||
if: github.event_name != 'pull_request' && (inputs.type == 'remote' || env.REGISTRY_USER != '')
|
||||
|
||||
Reference in New Issue
Block a user