Skip to content

Instantly share code, notes, and snippets.

@yaakaito
Created January 25, 2024 11:45
Show Gist options
  • Save yaakaito/3ae50f9e8952f97ef8fcab4f6b74481b to your computer and use it in GitHub Desktop.
Save yaakaito/3ae50f9e8952f97ef8fcab4f6b74481b to your computer and use it in GitHub Desktop.
labeler で変更されたファイルに合わせて PR にラベルを付ける
actions/labeler で設定できる。
- https://github.com/actions/labeler
workflow と設定ファイルである `.github/labeler.yml` を作成する。
基本は `changed-files` を利用して変更されたファイルをに対応したラベルをつけるようにする。`any` や `all` を使うことでもう少し複雑な条件を作れる。
frontend:
- changed-files:
- any-glob-to-any-file: 'frontend/**/*'
name: "Pull Request Labeler"
on:
- pull_request
jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- id: label-the-PR
uses: actions/labeler@v5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment