Skip to content

Commit

Permalink
Update eslint.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rushi authored Sep 9, 2024
1 parent 6a40bf7 commit bab70ae
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,29 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions: write-all
permissions:
checks: write
pull-requests: write

jobs:
Lint:
name: 🧠 ES Lint
runs-on: ubuntu-latest

steps:
- name: Check if user belongs to the organization
id: check-org
run: |
ORG_NAME="xola"
USER=$(jq -r .pull_request.user.login $GITHUB_EVENT_PATH)
USER_ORG=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/users/$USER/orgs | jq -r ".[].login")
if [[ "$USER_ORG" == "$ORG_NAME" ]]; then
echo "User is a member of $ORG_NAME"
echo ::set-output name=org-member::true
else
echo "User is not a member of $ORG_NAME"
echo ::set-output name=org-member::false
exit 1
fi
- name: Run workflow if user is in organization
if: steps.check-org.outputs.org-member == 'true'
- name: Check user for team affiliation
uses: tspascoal/get-user-teams-membership@v2
id: teamAffiliation
with:
GITHUB_TOKEN: ${{ secrets.TEMP_ORG_READ_TOKEN }}
username: ${{ github.actor }}
organization: xola

- name: Stop workflow if user is no member
run: |
echo "User is in organization!"
echo "Debugging"
echo ${{steps.teamAffiliation.outputs.teams}}
exit 1
- uses: actions/checkout@v3
with:
Expand Down

0 comments on commit bab70ae

Please sign in to comment.