From a0e491fd143c5889ae9b6881909d69f3681901b5 Mon Sep 17 00:00:00 2001 From: Sai Kumar Battinoju Date: Wed, 11 Dec 2024 22:00:03 +0530 Subject: [PATCH] chore: clean up the workflow --- .github/workflows/unit-tests-and-lint.yml | 10 -------- .github/workflows/update-cache-policy.yml | 28 +++++------------------ 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/.github/workflows/unit-tests-and-lint.yml b/.github/workflows/unit-tests-and-lint.yml index deac21cae..b95731b7b 100644 --- a/.github/workflows/unit-tests-and-lint.yml +++ b/.github/workflows/unit-tests-and-lint.yml @@ -67,13 +67,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - temp: - uses: ./.github/workflows/update-cache-policy.yml - with: - policy_type: 'max-age=3600' - secrets: - 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 }} - PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/update-cache-policy.yml b/.github/workflows/update-cache-policy.yml index 1e719ff3e..8cca3587c 100644 --- a/.github/workflows/update-cache-policy.yml +++ b/.github/workflows/update-cache-policy.yml @@ -10,30 +10,16 @@ on: options: - no-store - max-age=3600 - workflow_call: - inputs: - policy_type: - type: string - required: true - secrets: - AWS_PROD_ACCOUNT_ID: - required: true - AWS_PROD_S3_BUCKET_NAME: - required: true - AWS_PROD_S3_SYNC_ROLE: - required: true - PAT: - required: true permissions: id-token: write # allows the JWT to be requested from GitHub's OIDC provider contents: read # This is required for actions/checkout jobs: - check-actor: + validate-actor: runs-on: ubuntu-latest steps: - - name: Check if valid actor + - name: Validate if actor is allowed to trigger the workflow env: ORG_NAME: rudderlabs TEAM_NAME: js-sdk @@ -45,17 +31,15 @@ jobs: -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/${{ env.ORG_NAME }}/teams/${{ env.TEAM_NAME }}/memberships/$actor) - echo "Response: $response" - if echo "$response" | grep -q '"state": "active"'; then - echo "$actor is a member of $TEAM_NAME" + echo "$actor is a member of $TEAM_NAME team" else - echo "$actor is NOT a member of $TEAM_NAME" + echo "$actor is NOT a member of $TEAM_NAME team" exit 1 fi update-cache-policy: - needs: check-actor + needs: validate-actor name: Update cache control policy for SDK artifacts runs-on: [self-hosted, Linux, X64] @@ -82,7 +66,7 @@ jobs: parallel_jobs=$((num_cores * 2)) echo "Detected $num_cores cores. Using $parallel_jobs parallel jobs." - prefixes=("adobe-analytics-js") + prefixes=("adobe-analytics-js" "v3" "v1.1") for prefix in "${prefixes[@]}"; do echo "Processing prefix: $prefix"