File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 4242 run : |
4343 user="${{ github.actor }}"
4444 repo="${{ github.repository }}"
45- status=$(curl -s -o /dev/null -w '%{http_code}' \
46- -H "Authorization: Bearer $GITHUB_TOKEN" \
45+ status=$(curl -L - s -o /dev/null -w '%{http_code}' \
46+ -H "Authorization: Bearer ${{ secrets. GITHUB_TOKEN }} " \
4747 -H "Accept: application/vnd.github+json" \
4848 "https://api.github.com/repos/$repo/collaborators/$user")
4949 echo "status $status for user $user"
5252 else
5353 echo "reviewer=" >> $GITHUB_OUTPUT
5454 fi
55- env :
56- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5755
5856 - name : Create Pull Request if necessary
57+ id : create-pr
5958 uses : peter-evans/create-pull-request@v7
6059 with :
6160 branch : auto-cleanup
6564 delete-branch : true
6665 token : ${{ secrets.AUTO_PR_TOKEN }}
6766 push-to-fork : ${{ vars.AUTO_PR_FORK_NAME != '' && vars.AUTO_PR_FORK_NAME || secrets.AUTO_PR_FORK_NAME }}
68- reviewers : ${{ steps.check-collaborator.outputs.reviewer }}
67+
68+ - name : set reviewer
69+ if : ${{ steps.check-collaborator.outputs.reviewer != '' && steps.check-collaborator.outputs.reviewer != null && steps.create-pr.outputs.pull-request-operation == 'created' }}
70+ run : |
71+ repo="${{ github.repository }}"
72+ curl -L \
73+ -X POST \
74+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
75+ -H "Accept: application/vnd.github+json" \
76+ -H "X-GitHub-Api-Version: 2022-11-28" \
77+ https://api.github.com/repos/$repo/pulls/${{steps.create-pr.outputs.pull-request-number}}/requested_reviewers \
78+ -d '{"reviewers":["${{ steps.check-collaborator.outputs.reviewer }}"]}'
You can’t perform that action at this time.
0 commit comments