File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 git config user.name "github-actions[bot]"
6161 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6262
63+ - name : Check actor permission
64+ id : check_perm
65+ env :
66+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67+ run : |
68+ PERM=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
69+ -H "Accept: application/vnd.github.v3+json" \
70+ "https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission" \
71+ | python -c "import sys, json; print(json.load(sys.stdin).get('permission',''))")
72+ echo "permission=$PERM" >> $GITHUB_OUTPUT
73+
6374 - name : Determine version bump
6475 id : bump-type
6576 run : |
@@ -102,6 +113,7 @@ jobs:
102113 git push origin HEAD --tags
103114
104115 - name : Create GitHub Release
116+ if : steps.check_perm.outputs.permission == 'write' || steps.check_perm.outputs.permission == 'admin'
105117 uses : actions/create-release@v1
106118 env :
107119 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments