Skip to content
Closed
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
40 changes: 40 additions & 0 deletions .github/workflows/test-read-token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: test-read-token

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
release:
name: Test reading NPM token
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{secrets.PUSH_TOKEN}}
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"
- name: Configure AWS Credentials
id: credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.JS_TEAM_ROLE_TO_ASSUME }}
role-session-name: SmithyTypeScriptGitHubRelease
audience: sts.amazonaws.com
- name: Fetch NPM token
id: token
run: |
aws configure --profile token set role_arn ${{ secrets.JS_TEAM_TOKEN_ROLE }}
aws configure --profile token set credential_source Environment
npm_token=$(aws secretsmanager get-secret-value --region us-west-2 --secret-id=smithy-typescript-npm-token --query SecretString --output text --profile token)
echo "::add-mask::$npm_token"
echo "NPM_TOKEN=$npm_token" >> $GITHUB_ENV
Loading