Skip to content

Commit 44982dd

Browse files
committed
Fixed release workflow.
1 parent df973e4 commit 44982dd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ jobs:
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 }}

0 commit comments

Comments
 (0)