File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Dependabot Coverage Upload
2+
3+ on :
4+ issue_comment :
5+ types : [created]
6+
7+ jobs :
8+ check :
9+ if : github.event.issue.pull_request != null && github.event.comment.body == '/upload-coverage'
10+ runs-on : ubuntu-latest
11+ outputs :
12+ allowed : ${{ steps.gate.outputs.allowed }}
13+ steps :
14+ - name : Gate check
15+ id : gate
16+ run : |
17+ set -euo pipefail
18+ PERM=$(gh api "repos/$GITHUB_REPOSITORY/collaborators/$COMMENT_USER_LOGIN/permission" --jq '.permission' 2>/dev/null || echo "none")
19+ if [ "$PERM" = "admin" ] || [ "$PERM" = "maintain" ]; then
20+ echo "allowed=true" >> $GITHUB_OUTPUT
21+ else
22+ echo "allowed=false" >> $GITHUB_OUTPUT
23+ fi
24+ env :
25+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26+ COMMENT_USER_LOGIN : ${{ github.event.comment.user.login }}
27+
28+ upload :
29+ needs : check
30+ if : needs.check.outputs.allowed == 'true'
31+ uses : adobe/aio-reusable-workflows/.github/workflows/dependabot-coverage-upload.yml@main
32+ secrets :
33+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
You can’t perform that action at this time.
0 commit comments