Skip to content

Commit 0b3faac

Browse files
authored
Update s3-upload.yml
1 parent cda999f commit 0b3faac

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

.github/workflows/s3-upload.yml

+6-17
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,13 @@ jobs:
1818

1919

2020
################### Steps mentioned in this block would later be moved to the cloud’s login action#######################
21-
22-
# Get ID token from GitHub OIDC provider
23-
- uses: actions/setup-node@v2
24-
- run: npm install @actions/[email protected]
25-
- uses: actions/github-script@v4
26-
id: idtoken
27-
with:
28-
# Audience field is optional. By default, the value is the repo's url. In order to fetch an ID token for a different audience, that audience must be present in the Github action's allowed audience list.
29-
script: |
30-
const coredemo = require('@actions/core')
31-
let id_token = await coredemo.getIDToken()
32-
coredemo.setOutput('id_token', id_token)
33-
# Get credentials. Change --role-arn value to your role arn
3421
- run: |
35-
jwtd() {
36-
if [[ -x $(command -v jq) ]]; then
22+
IDTOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sigstore" | jq -r '.value')
23+
echo $IDTOKEN
24+
jwtd() {
25+
if [[ -x $(command -v jq) ]]; then
3726
jq -R 'split(".") | .[0],.[1] | @base64d | fromjson' <<< "${1}"
3827
echo "Signature: $(echo "${1}" | awk -F'.' '{print $3}')"
3928
fi
40-
}
41-
jwtd ${{ steps.idtoken.outputs.id_token }}
29+
}
30+
jwtd $IDTOKEN

0 commit comments

Comments
 (0)