Add "✨ Vibe Coded" label to PRs created by @Copilot (#5137) * Initial plan * Add label-copilot-prs job to automatically add "✨ Vibe Coded" label to PRs created by @Copilot Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Signed| @@ -91,7 +91,7 @@ jobs: | ||
| 91 | 91 | label-by-size: |
| 92 | 92 | name: 🏷️ Label PR by Size |
| 93 | 93 | # This job should run after all others, to prevent possible concurrency issues |
| 94 | 94 | needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label, check-merge-blocking-labels, write-auto-comments] |
| 95 | 95 | runs-on: ubuntu-latest |
| 96 | 96 | # Only needs to run when code is changed |
| 97 | 97 | if: always() && (github.event.action == 'opened' || github.event.action == 'synchronize') |
| @@ -196,9 +196,38 @@ jobs: | ||
| 196 | 196 | configuration-path: .github/pr-auto-labels-by-files.yml |
| 197 | 197 | repo-token: ${{ steps.app.outputs.token }} |
| 198 | 198 | |
| 199 | + label-copilot-prs: | |
| 200 | + name: 🏷️ Label Copilot PRs as Vibe Coded | |
| 201 | + runs-on: ubuntu-latest | |
| 202 | + # Only label once when PR is created by Copilot | |
| 203 | + if: > | |
| 204 | + github.event.action == 'opened' && | |
| 205 | + github.event.pull_request.user.login == 'Copilot' | |
| 206 | + | |
| 207 | + steps: | |
| 208 | + - name: Mint App Token | |
| 209 | + id: app | |
| 210 | + # Create a GitHub App token | |
| 211 | + # https://github.com/marketplace/actions/create-github-app-token | |
| 212 | + uses: actions/create-github-app-token@v2 | |
| 213 | + with: | |
| 214 | + app-id: ${{ vars.ST_BOT_APP_ID }} | |
| 215 | + private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }} | |
| 216 | + owner: ${{ github.repository_owner }} | |
| 217 | + | |
| 218 | + - name: Add Vibe Coded Label | |
| 219 | + # 🤖 Issues Helper | |
| 220 | + # https://github.com/marketplace/actions/issues-helper | |
| 221 | + uses: actions-cool/issues-helper@v3.6.0 | |
| 222 | + with: | |
| 223 | + actions: 'add-labels' | |
| 224 | + token: ${{ steps.app.outputs.token }} | |
| 225 | + issue-number: ${{ github.event.pull_request.number }} | |
| 226 | + labels: '✨ Vibe Coded' | |
| 227 | + | |
| 199 | 228 | remove-stale-label: |
| 200 | 229 | name: 🗑️ Remove Stale Label on Comment |
| 201 | 230 | needs: [label-by-branches, label-by-files, label-copilot-prs] |
| 202 | 231 | runs-on: ubuntu-latest |
| 203 | 232 | # Only runs on comments not done by the github actions bot |
| 204 | 233 | if: always() && (github.event_name == 'pull_request_review_comment' && github.event.sender.type != 'Bot') |
| @@ -236,7 +265,7 @@ jobs: | ||
| 236 | 265 | |
| 237 | 266 | check-merge-blocking-labels: |
| 238 | 267 | name: 🚫 Check Merge Blocking Labels |
| 239 | 268 | needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label] |
| 240 | 269 | runs-on: ubuntu-latest |
| 241 | 270 | # Run, even if the previous jobs were skipped/failed |
| 242 | 271 | if: always() |
| @@ -286,7 +315,7 @@ jobs: | ||
| 286 | 315 | |
| 287 | 316 | write-auto-comments: |
| 288 | 317 | name: 💬 Post PR Comments Based on Labels |
| 289 | 318 | needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label, check-merge-blocking-labels] |
| 290 | 319 | runs-on: ubuntu-latest |
| 291 | 320 | # Run, even if the previous jobs were skipped/failed |
| 292 | 321 | if: always() && (github.event_name == 'pull_request_target') |