Skip to content

Commit

Permalink
chore: clean up the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs committed Dec 11, 2024
1 parent c24f1b9 commit a0e491f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/unit-tests-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
28 changes: 6 additions & 22 deletions .github/workflows/update-cache-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]

Expand All @@ -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"
Expand Down

0 comments on commit a0e491f

Please sign in to comment.