Skip to content

Commit 3f185c5

Browse files
uniqueckshoelzle
authored andcommitted
Build: Add labels based on Dependabot PRs
1 parent ddd5af4 commit 3f185c5

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Dependabot auto-label
2+
on: pull_request
3+
4+
permissions:
5+
pull-requests: write
6+
issues: write
7+
8+
jobs:
9+
get-metadata:
10+
uses: ./.github/workflows/dependabot-metadata.yml
11+
12+
dependabot:
13+
runs-on: ubuntu-latest
14+
needs: get-metadata
15+
steps:
16+
- name: Add a label for all production dependencies
17+
if: needs.get-metadata.outputs.dependency-type == 'direct:production'
18+
run: gh pr edit "$PR_URL" --add-label "dep:production"
19+
env:
20+
PR_URL: ${{ github.event.pull_request.html_url }}
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Add a label for all development dependencies
23+
if: needs.get-metadata.outputs.dependency-type == 'direct:development'
24+
run: gh pr edit "$PR_URL" --add-label "dep:development"
25+
env:
26+
PR_URL: ${{ github.event.pull_request.html_url }}
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Add a label for all indirect dependencies
29+
if: needs.get-metadata.outputs.dependency-type == 'indirect'
30+
run: gh pr edit "$PR_URL" --add-label "dep:indirect"
31+
env:
32+
PR_URL: ${{ github.event.pull_request.html_url }}
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)