Skip to content

Commit b65541d

Browse files
BUILD-9771 reduce AWS creds exposure
1 parent 89853ab commit b65541d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ runs:
3535
using: composite
3636
steps:
3737
- name: Authenticate to AWS
38+
id: aws-auth
3839
shell: bash
3940
env:
4041
POOL_ID: ${{ inputs.environment == 'prod' && 'eu-central-1:511fe374-ae4f-46d0-adb7-9246e570c7f4' || 'eu-central-1:3221c6ea-3f67-4fd8-a7ff-7426f96add89' }}
@@ -89,9 +90,9 @@ runs:
8990
exit 1
9091
fi
9192
92-
echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" >> $GITHUB_ENV
93-
echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> $GITHUB_ENV
94-
echo "AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN" >> $GITHUB_ENV
93+
echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" >> "$GITHUB_OUTPUT"
94+
echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> "$GITHUB_OUTPUT"
95+
echo "AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN" >> "$GITHUB_OUTPUT"
9596
9697
- name: Prepare cache keys
9798
shell: bash
@@ -140,6 +141,9 @@ runs:
140141
RUNS_ON_S3_BUCKET_CACHE: sonarsource-s3-cache-${{ inputs.environment }}-bucket
141142
AWS_DEFAULT_REGION: eu-central-1
142143
AWS_REGION: eu-central-1
144+
AWS_ACCESS_KEY_ID: ${{ steps.aws-auth.outputs.AWS_ACCESS_KEY_ID }}
145+
AWS_SECRET_ACCESS_KEY: ${{ steps.aws-auth.outputs.AWS_SECRET_ACCESS_KEY }}
146+
AWS_SESSION_TOKEN: ${{ steps.aws-auth.outputs.AWS_SESSION_TOKEN }}
143147
with:
144148
path: ${{ inputs.path }}
145149
key: ${{ steps.prepare-keys.outputs.branch-key }}

0 commit comments

Comments
 (0)