0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【GitHub Copilot Workspace】Workspaceが作成したPRに自動的にラベルをつける

Posted at

やったこと

ラベル作成

プルリクのラベル画面にてcopilot workspaceのラベルを追加
https://github.com/{YOUR_NAME}/{YOUR_REPOSITORY}/labels
スクリーンショット 2024-05-29 1.19.51.png

ファイル追加

以下の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ラベルがつけられる

スクリーンショット 2024-05-29 1.15.42.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?