File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 name : Check PR author
1313 runs-on : ubuntu-latest
1414 steps :
15- - uses : mitchellh/vouch/action/check-pr@c6d80ead49839655b61b422700b7a3bc9d0804a9 # v1.4.2
15+ - name : Check if reopened by a maintainer
16+ id : maintainer
17+ if : github.event.action == 'reopened'
18+ env :
19+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20+ ACTOR : ${{ github.actor }}
21+ REPO : ${{ github.repository }}
22+ run : |
23+ PERMISSION=$(gh api "repos/$REPO/collaborators/$ACTOR/permission" --jq '.permission' 2>/dev/null || echo "none")
24+ echo "Actor $ACTOR has permission: $PERMISSION"
25+ if [[ "$PERMISSION" == "admin" || "$PERMISSION" == "maintain" || "$PERMISSION" == "write" ]]; then
26+ echo "is_maintainer=true" >> "$GITHUB_OUTPUT"
27+ else
28+ echo "is_maintainer=false" >> "$GITHUB_OUTPUT"
29+ fi
30+
31+ - name : Vouch check
32+ if : github.event.action == 'opened' || steps.maintainer.outputs.is_maintainer != 'true'
33+ uses : mitchellh/vouch/action/check-pr@c6d80ead49839655b61b422700b7a3bc9d0804a9 # v1.4.2
1634 with :
1735 pr-number : ${{ github.event.pull_request.number }}
1836 auto-close : true
You can’t perform that action at this time.
0 commit comments