やったこと
ラベル作成
プルリクのラベル画面にてcopilot workspace
のラベルを追加
https://github.com/{YOUR_NAME}/{YOUR_REPOSITORY}/labels
ファイル追加
以下の2ファイルをリポジトリに追加
.github/workflows/label-copilot-pr.yml
name: Label PR
on:
pull_request_target:
types: [opened, synchronize, reopened]
permissions:
contents: write
pull-requests: write
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Label PR
uses: actions/labeler@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
.github/labeler.yml
# .github/labeler.yml
copilot workspace:
- '**/*'
リポジトリのWorkflow permissionsを変更
Settings -> Actions -> Generalに遷移
Workflow permissionsのRead and write permissionsをクリックしてSave
https://github.com/{YOUR_NAME}/{YOUR_REPOSITORY}/settings/actions
結果
Copilot Workspaceが作ったプルリクにcopilot workspace
ラベルがつけられる