Skip to content

Commit 50b132f

Browse files
author
Sri Manaswi Chirumamilla
committed
feat: ACNA-4537 add dependabot coverage upload workflow
1 parent c7fd0db commit 50b132f

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 }}

0 commit comments

Comments
 (0)