Skip to content

Commit

Permalink
chore: add check for actor
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs committed Dec 11, 2024
1 parent f5943e7 commit f3ec703
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/unit-tests-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ jobs:
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 }}
24 changes: 23 additions & 1 deletion .github/workflows/update-cache-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,35 @@ on:
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:
runs-on: ubuntu-latest
steps:
- name: Check if valid actor
env:
ORG_NAME: rudderlabs
TEAM_NAME: js-sdk
run: |
actor=${{ github.actor || github.triggering_actor }}
response=$(curl -s -H "Authorization: Bearer ${{ secrets.PAT }}" \
"https://api.github.com/orgs/$ORG_NAME/teams/$TEAM_NAME/members/$actor")
if echo "$response" | grep -q '"state": "active"'; then
echo "$actor is a member of $TEAM_NAME"
else
echo "$actor is NOT a member of $TEAM_NAME"
exit 1
fi
update-cache-policy:
needs: check-actor
name: Update cache control policy for SDK artifacts
runs-on: [self-hosted, Linux, X64]

Expand All @@ -55,7 +77,7 @@ jobs:
parallel_jobs=$((num_cores * 2))
echo "Detected $num_cores cores. Using $parallel_jobs parallel jobs."
prefixes=("adobe-analytics-js" "latest")
prefixes=("adobe-analytics-js")
for prefix in "${prefixes[@]}"; do
echo "Processing prefix: $prefix"
Expand Down

0 comments on commit f3ec703

Please sign in to comment.