Skip to content

Commit

Permalink
Update mike.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmadigan authored May 13, 2024
1 parent a0422dc commit 41a8280
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/mike.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ jobs:
if: startsWith(github.event.comment.body, '/mike deploy')

- name: Validate User
id: validate_user
run: |
USER_PERMISSION=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission")
echo "User permissions: $USER_PERMISSION"
if [[ "$USER_PERMISSION" =~ (\"permission\": \"admin\") ]]; then
echo "User is authorized to deploy."
echo "can_deploy=true" >> $GITHUB_ENV
echo "::set-output name=can_deploy::true"
else
echo "::error::User is not authorized to deploy."
echo "can_deploy=false" >> $GITHUB_ENV
echo "::set-output name=can_deploy::false"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 41a8280

Please sign in to comment.