Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/workflows/release-drafter-verify_pr_labels.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/verify_issue_labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will verify that all issues have at
# least one of the [scope] labels and one of the [priority] labels

name: Verify issue labels
on:
issues:
types: [opened, labeled, unlabeled]

jobs:
check_issue_labels:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Require [scope] label
uses: trstringer/require-label-prefix@v1
with:
secret: ${{ github.TOKEN }}
Comment thread
rozyczko marked this conversation as resolved.
prefix: "[scope]"
addLabel: true
defaultLabel: "[scope] ⚠️ label needed"
Comment thread
rozyczko marked this conversation as resolved.

- name: Require [priority] label
if: always()
uses: trstringer/require-label-prefix@v1
with:
secret: ${{ github.TOKEN }}
prefix: "[priority]"
addLabel: true
defaultLabel: "[priority] ⚠️ label needed"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow doesn't explicitly declare permissions. GITHUB_TOKEN gives you default permissions, but I think it's better to be explicit about what the workflow needs:

permissions:
  issues: write

13 changes: 7 additions & 6 deletions .github/workflows/verify_pr_labels.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# This workflow will be verify that all PRs have at
# least on the label: 'bugs', 'enhancement' before
# they can be merged.
# This workflow will verify that all PRs have at
# least one of the [scope] labels before they can be merged.

name: Verify PR labels
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

jobs:
check_pr_labels:
check_pr_label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
name: Verify that the PR has a valid label
steps:
- name: Verify PR label action
uses: jesusvasquez333/verify-pr-label-action@v1.4.0
id: verify-pr-label
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
valid-labels: chore, fix, bugfix, bug, enhancement, feature, dependencies, documentation
github-token: ${{ github.TOKEN }}
valid-labels: '[scope] bug, [scope] enhancement, [scope] documentation, [scope] significant, [scope] maintenance'
pull-request-number: ${{ github.event.pull_request.number }}
disable-reviews: false
Loading