Skip to content

Commit

Permalink
Remove dependency on octokit.
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schilling committed Mar 23, 2024
1 parent e06006e commit 59cefa6
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/new_member.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@ jobs:
steps:
- name: Check if commenter is in the admins team
id: check_membership
uses: octokit/[email protected]
with:
route: GET /orgs/{org}/teams/{team_slug}/memberships/${{ github.event.comment.user.login }}
org: 'django-community'
team_slug: 'admins'
env:
GITHUB_TOKEN: ${{ secrets.ORG_CONTROLS_PAT }}
continue-on-error: true # Prevents the workflow from failing if the user is not a team member.
- name: Determine is issue commenter has permission to approve
run: |
if [ "${{ steps.check_membership.outputs.response.status }}" == "200" ]; then
echo "::set-output name=is_team_member::true"
ROLE=$(gh api -X GET /orgs/{org}/teams/{team_slug}/memberships/${{ github.event.comment.user.login }} --jq '.role')
if [[ "$ROLE" == "maintainer" ]]; then
echo "is_team_member=true" >> $GITHUB_OUTPUT
else
echo "::set-output name=is_team_member::false"
echo "is_team_member=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.ORG_CONTROLS_PAT }}
continue-on-error: true # Prevents the workflow from failing if the user is not a team member.

invite:
needs: check-team-membership
Expand Down

0 comments on commit 59cefa6

Please sign in to comment.