Skip to content

Commit 772e0d3

Browse files
ci: add PR trigger with environment gate for e2e tests (aws#325)
Add pull_request trigger on main and e2e-testing environment to gate e2e test execution behind approval.
1 parent 7c51a20 commit 772e0d3

2 files changed

Lines changed: 53 additions & 15 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
aws_region:
66
description: 'AWS region for deployment'
77
default: 'us-east-1'
8+
pull_request:
9+
branches: [main]
810

911
permissions:
1012
id-token: write # OIDC — lets GitHub assume an AWS IAM role via short-lived token (no stored keys)
@@ -13,6 +15,7 @@ permissions:
1315
jobs:
1416
e2e:
1517
runs-on: ubuntu-latest
18+
environment: e2e-testing
1619
timeout-minutes: 30
1720
steps:
1821
- uses: actions/checkout@v6
@@ -29,7 +32,7 @@ jobs:
2932
uses: aws-actions/configure-aws-credentials@v4
3033
with:
3134
role-to-assume: ${{ secrets.E2E_AWS_ROLE_ARN }}
32-
aws-region: ${{ inputs.aws_region }}
35+
aws-region: ${{ inputs.aws_region || 'us-east-1' }}
3336
- name: Get AWS Account ID
3437
id: aws
3538
run: echo "account_id=$(aws sts get-caller-identity --query Account --output text)" >> "$GITHUB_OUTPUT"
@@ -38,5 +41,5 @@ jobs:
3841
- name: Run E2E tests
3942
env:
4043
AWS_ACCOUNT_ID: ${{ steps.aws.outputs.account_id }}
41-
AWS_REGION: ${{ inputs.aws_region }}
44+
AWS_REGION: ${{ inputs.aws_region || 'us-east-1' }}
4245
run: npm run test:e2e

package-lock.json

Lines changed: 48 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)