From 1f1bdb5cb3c9378223c09fc17d12f971dc6c1060 Mon Sep 17 00:00:00 2001 From: Sai Kumar Battinoju Date: Wed, 11 Dec 2024 18:30:21 +0530 Subject: [PATCH] chore: fix secrets --- .github/workflows/unit-tests-and-lint.yml | 6 +++--- .github/workflows/update-cache-policy.yml | 17 +++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/unit-tests-and-lint.yml b/.github/workflows/unit-tests-and-lint.yml index aba037c24..1cd1503b6 100644 --- a/.github/workflows/unit-tests-and-lint.yml +++ b/.github/workflows/unit-tests-and-lint.yml @@ -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 }} diff --git a/.github/workflows/update-cache-policy.yml b/.github/workflows/update-cache-policy.yml index 5862d7f21..ceac1a78e 100644 --- a/.github/workflows/update-cache-policy.yml +++ b/.github/workflows/update-cache-policy.yml @@ -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: @@ -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 @@ -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 }}"