Skip to content

Commit

Permalink
ci(pr-labeler): replace TimonVS/pr-labeler-action
Browse files Browse the repository at this point in the history
Replace the `TimonVS/pr-labeler-action` with
`release-drafter/release-drafter` as it has an [`autolabeler`][1]
option that can autolabel PRs for us.

This should fix labeling PRs from forks,
see TimonVS/pr-labeler-action#25.

I've kept the `.github/pr-labeler.yml` configuration file, so that
links to it from the https://mermaid.js.org website continue to work.

I've also kept everything in the same
`.github/workflows/pr-labeler.yml` GitHub Actions workflow to make the
`git diff` easier to review, and to keep the GitHub Actions permissions
the same.

[1]: https://github.com/release-drafter/release-drafter/blob/ff929b5ceb21bf2646a216e916f9a8bb507d48a3/README.md#autolabeler
  • Loading branch information
aloisklink committed Sep 24, 2023
1 parent 672a289 commit a1673d3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 38 deletions.
32 changes: 19 additions & 13 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
'Type: Bug / Error':
- 'bug/*'
- 'fix/*'
'Type: Enhancement':
- 'feature/*'
- 'feat/*'
'Type: Other':
- 'other/*'
- 'chore/*'
- 'test/*'
- 'refactor/*'
'Area: Documentation':
- 'docs/*'
# yaml-language-server: $schema=https://raw.githubusercontent.com/release-drafter/release-drafter/master/schema.json
autolabeler:
- label: 'Type: Bug / Error'
branch:
- '/bug\/.+/'
- '/fix\/.+/'
- label: 'Type: Enhancement'
branch:
- '/feature\/.+/'
- '/feat\/.+/'
- label: 'Type: Other'
branch:
- '/other\/.+/'
- '/chore\/.+/'
- '/test\/.+/'
- '/refactor\/.+/'
- label: 'Area: Documentation'
branch:
- '/docs\/.+/'
23 changes: 0 additions & 23 deletions .github/workflows/pr-labeler-config-validator.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
# Please read the following first before reviewing/merging:
# - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
# - https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
types: [opened]
types: [opened, reopened, synchronize]

permissions:
contents: read
Expand All @@ -22,6 +22,10 @@ jobs:
pull-requests: write # write permission is required to label PRs
steps:
- name: Label PR
uses: TimonVS/pr-labeler-action@v4
uses: release-drafter/release-drafter@v5
with:
config-name: pr-labeler.yml
disable-autolabeler: false
disable-releaser: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ jobs:
steps:
- name: Draft Release
uses: release-drafter/release-drafter@v5
with:
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a1673d3

Please sign in to comment.