Skip to content

Commit

Permalink
fix: redirect error when checking team
Browse files Browse the repository at this point in the history
closes #22
  • Loading branch information
joshjohanning committed Dec 3, 2023
1 parent f23e34a commit 91cb94b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,9 @@ runs:
fi
done
# getting team membership"
# checking team and getting team membership"
echo "getting team membership for the team: @${{ github.repository_owner }}/${{ inputs.team-name }} ..."
users=$(gh api --paginate '${{ github.event.organization.url }}/teams/${{ inputs.team-name }}/members' --jq '.[].login')
if [ $? -ne 0 ]; then
echo "::error title=Team doesn't exist or token doesn't have access::The ${{ inputs.team-name }} team doesn't exist or the token doesn't have access to it"
exit 1
fi
users=$(gh api --paginate '${{ github.event.organization.url }}/teams/${{ inputs.team-name }}/members' --jq '.[].login' 2> /dev/null) || { echo "::error title=Team doesn't exist or token doesn't have access::The ${{ inputs.team-name }} team doesn't exist or the token doesn't have access to it"; exit 1; }
approveCommand="${{ inputs.approve-command }}"
authorized=false
Expand Down

0 comments on commit 91cb94b

Please sign in to comment.