Skip to content

Commit 14b6c35

Browse files
chore: fix packaging workflow (#805)
* fix: token permission in package workflow conflicting with unit tests * change secret arn and role to assume in package workflow --------- Co-authored-by: Tom Keller <[email protected]>
1 parent 22617f9 commit 14b6c35

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/package.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77
paths-ignore:
88
- 'dist/**'
9+
workflow_dispatch:
910

1011
jobs:
1112
package:
@@ -30,15 +31,15 @@ jobs:
3031
uses: aws-actions/configure-aws-credentials@v3
3132
with:
3233
aws-region: us-west-2
33-
role-to-assume: ${{ secrets.SECRETS_AWS_ROLE_TO_ASSUME }}
34+
role-to-assume: ${{ secrets.SECRETS_AWS_PACKAGING_ROLE_TO_ASSUME }}
3435
role-duration-seconds: 900
3536
role-session-name: SecretsManagerFetch
3637
- name: Get bot user token
3738
uses: aws-actions/aws-secretsmanager-get-secrets@v1
3839
with:
3940
parse-json-secrets: true
4041
secret-ids: |
41-
OSDS,arn:aws:secretsmanager:us-west-2:294535624312:secret:github-aws-sdk-osds-automation-ZHNalp
42+
OSDS,arn:aws:secretsmanager:us-west-2:206735643321:secret:github-aws-sdk-osds-automation-gebs9n
4243
- name: Commit
4344
run: |
4445
echo "::add-mask::${{ env.OSDS_ACCESS_TOKEN }}"

test/index.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ describe('Configure AWS Credentials', () => {
508508
});
509509

510510
test('GH OIDC check fails if token is not set', async () => {
511+
process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'] = undefined;
511512
process.env['GITHUB_ACTIONS'] = 'true';
512513
jest.spyOn(core, 'getInput').mockImplementation(
513514
mockGetInput({
@@ -528,6 +529,7 @@ describe('Configure AWS Credentials', () => {
528529
});
529530

530531
test('Assume role with existing credentials if nothing else set', async () => {
532+
process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'] = undefined;
531533
process.env['AWS_ACCESS_KEY_ID'] = FAKE_ACCESS_KEY_ID;
532534
process.env['AWS_SECRET_ACCESS_KEY'] = FAKE_SECRET_ACCESS_KEY;
533535
jest.spyOn(core, 'getInput').mockImplementation(

0 commit comments

Comments
 (0)