Skip to content

Commit

Permalink
chore: fix secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs committed Dec 11, 2024
1 parent 93cbfa6 commit 1f1bdb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ jobs:
with:
policy_type: 'no-store'
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
AWS_S3_SYNC_ROLE: ${{ secrets.AWS_S3_SYNC_ROLE }}
AWS_PROD_ACCOUNT_ID: ${{ secrets.AWS_PROD_ACCOUNT_ID }}
AWS_PROD_S3_BUCKET_NAME: ${{ secrets.AWS_PROD_S3_BUCKET_NAME }}
AWS_PROD_S3_SYNC_ROLE: ${{ secrets.AWS_PROD_S3_SYNC_ROLE }}
17 changes: 7 additions & 10 deletions .github/workflows/update-cache-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ on:
type: string
required: true
secrets:
AWS_ACCOUNT_ID:
description: AWS Account ID
AWS_PROD_ACCOUNT_ID:
required: true
AWS_S3_BUCKET_NAME:
description: AWS S3 Bucket Name
AWS_PROD_S3_BUCKET_NAME:
required: true
AWS_S3_SYNC_ROLE:
description: AWS S3 Sync Role
AWS_PROD_S3_SYNC_ROLE:
required: true

permissions:
Expand All @@ -42,7 +39,7 @@ jobs:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_S3_SYNC_ROLE }}
role-to-assume: arn:aws:iam::${{ secrets.AWS_PROD_ACCOUNT_ID }}:role/${{ secrets.AWS_PROD_S3_SYNC_ROLE }}
aws-region: us-east-1

- name: Determine the cache control policy
Expand All @@ -52,10 +49,10 @@ jobs:
- name: Update cache control policy
run: |
aws s3api list-objects --bucket ${{ secrets.AWS_S3_BUCKET_NAME }} --prefix adobe-analytics-js --query "Contents[].Key" --output text | while read key; do
aws s3api list-objects --bucket ${{ secrets.AWS_PROD_S3_BUCKET_NAME }} --prefix adobe-analytics-js --query "Contents[].Key" --output text | while read key; do
aws s3api copy-object \
--bucket ${{ secrets.AWS_S3_BUCKET_NAME }} \
--copy-source ${{ secrets.AWS_S3_BUCKET_NAME }}/$key \
--bucket ${{ secrets.AWS_PROD_S3_BUCKET_NAME }} \
--copy-source ${{ secrets.AWS_PROD_S3_BUCKET_NAME }}/$key \
--key $key \
--metadata-directive REPLACE \
--cache-control "${{ env.cache_control_policy }}"
Expand Down

0 comments on commit 1f1bdb5

Please sign in to comment.