Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/.e2e-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,6 +40,9 @@ env:
jobs:
run:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -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 != '')
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

permissions:
contents: read
id-token: write

Check failure

Code scanning / zizmor

overly broad permissions: id-token: write is overly broad at the workflow level Error

overly broad permissions: id-token: write is overly broad at the workflow level

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -99,14 +100,15 @@
name: ${{ matrix.name }}
registry: ${{ matrix.registry }}
slug: ${{ matrix.slug }}
aws-role-to-assume: arn:aws:iam::175142243308:role/official_gha_cicd
secrets:
# Pass only the two secrets needed by each matrix entry.
# AWS ECR entries use OIDC via aws-role-to-assume instead of static keys.
registry_username: >-
${{
matrix.auth == 'dockerhub' && secrets.DOCKERHUB_USERNAME ||
matrix.auth == 'ghcr' && secrets.GHCR_USERNAME ||
matrix.auth == 'gitlab' && secrets.GITLAB_USERNAME ||
matrix.auth == 'aws' && secrets.AWS_ACCESS_KEY_ID ||
matrix.auth == 'gar' && secrets.GAR_USERNAME ||
matrix.auth == 'acr' && secrets.AZURE_CLIENT_ID ||
matrix.auth == 'quay' && secrets.QUAY_USERNAME ||
Expand All @@ -118,7 +120,6 @@
matrix.auth == 'dockerhub' && secrets.DOCKERHUB_TOKEN ||
matrix.auth == 'ghcr' && secrets.GHCR_PAT ||
matrix.auth == 'gitlab' && secrets.GITLAB_TOKEN ||
matrix.auth == 'aws' && secrets.AWS_SECRET_ACCESS_KEY ||
matrix.auth == 'gar' && secrets.GAR_JSON_KEY ||
matrix.auth == 'acr' && secrets.AZURE_CLIENT_SECRET ||
matrix.auth == 'quay' && secrets.QUAY_TOKEN ||
Expand Down
Loading