Skip to content

Commit 8564008

Browse files
committed
ci: add AWS authentication step for integration tests
Matches the pattern used by the amazon_bedrock workflow: - top-level id-token: write permission - AWS_REGION env var - configure-aws-credentials step (skipped on fork PRs and dependabot) - integration tests gated on successful auth
1 parent 90c4977 commit 8564008

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/amazon_s3_vectors.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ concurrency:
2626
group: amazon_s3_vectors-${{ github.head_ref || github.sha }}
2727
cancel-in-progress: true
2828

29+
permissions:
30+
id-token: write
31+
contents: read
32+
2933
env:
3034
PYTHONUNBUFFERED: "1"
3135
FORCE_COLOR: "1"
3236
TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]'
3337
TEST_MATRIX_PYTHON: '["3.10", "3.14"]'
3438

39+
AWS_REGION: "us-east-1"
40+
3541
jobs:
3642
compute-test-matrix:
3743
runs-on: ubuntu-slim
@@ -51,6 +57,7 @@ jobs:
5157
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
5258
needs: compute-test-matrix
5359
permissions:
60+
id-token: write
5461
contents: write
5562
pull-requests: write
5663
runs-on: ${{ matrix.os }}
@@ -101,7 +108,17 @@ jobs:
101108
name: coverage-comment-amazon_s3_vectors
102109
path: python-coverage-comment-action-amazon_s3_vectors.txt
103110

111+
# Do not authenticate on PRs from forks and on PRs created by dependabot
112+
- name: AWS authentication
113+
id: aws-auth
114+
if: github.event_name == 'schedule' || (github.event.pull_request.head.repo.full_name == github.repository && !startsWith(github.event.pull_request.head.ref, 'dependabot/'))
115+
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37
116+
with:
117+
aws-region: ${{ env.AWS_REGION }}
118+
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
119+
104120
- name: Run integration tests
121+
if: success() && steps.aws-auth.outcome == 'success'
105122
run: hatch run test:integration-cov-append-retry
106123

107124
- name: Store combined coverage

0 commit comments

Comments
 (0)