Skip to content

Commit

Permalink
add permissions field
Browse files Browse the repository at this point in the history
  • Loading branch information
lassemand committed Nov 4, 2024
1 parent 0423928 commit da96777
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,15 @@ env:
}'
AWS_ROLE_TO_ASSUME: 'arn:aws:iam::192549843005:role/github_concordium-client'


permissions:
id-token: write
contents: read

jobs:
validate-preconditions:
runs-on: ubuntu-latest
environment: release
steps:
- name: Retrieve GitHub OIDC Token and Extract Sub
id: oidc_token
run: |
# Fetch OIDC token from GitHub
oidc_token=$(curl -s -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL" | jq -r '.value')
# Decode the token and extract 'sub' (subject) claim
sub=$(echo "${oidc_token}" | base64 -d | jq -r '.sub')
echo "OIDC sub: $sub"
echo "sub=${sub}" >> "$GITHUB_ENV"
env:
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ steps.auth.outputs.id-token }}
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down

0 comments on commit da96777

Please sign in to comment.