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 | label-by-size: | 91 | label-by-size: |
| 92 | name: 🏷️ Label PR by Size | 92 | name: 🏷️ Label PR by Size |
| 93 | # This job should run after all others, to prevent possible concurrency issues | 93 | # This job should run after all others, to prevent possible concurrency issues |
| 94 | needs: [label-by-branches, label-by-files, remove-stale-label, check-merge-blocking-labels, write-auto-comments] | 94 | needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label, check-merge-blocking-labels, write-auto-comments] |
| 95 | runs-on: ubuntu-latest | 95 | runs-on: ubuntu-latest |
| 96 | # Only needs to run when code is changed | 96 | # Only needs to run when code is changed |
| 97 | if: always() && (github.event.action == 'opened' || github.event.action == 'synchronize') | 97 | if: always() && (github.event.action == 'opened' || github.event.action == 'synchronize') |
| @@ -196,9 +196,38 @@ jobs: | |||
| 196 | configuration-path: .github/pr-auto-labels-by-files.yml | 196 | configuration-path: .github/pr-auto-labels-by-files.yml |
| 197 | repo-token: ${{ steps.app.outputs.token }} | 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 | remove-stale-label: | 228 | remove-stale-label: |
| 200 | name: 🗑️ Remove Stale Label on Comment | 229 | name: 🗑️ Remove Stale Label on Comment |
| 201 | needs: [label-by-branches, label-by-files] | 230 | needs: [label-by-branches, label-by-files, label-copilot-prs] |
| 202 | runs-on: ubuntu-latest | 231 | runs-on: ubuntu-latest |
| 203 | # Only runs on comments not done by the github actions bot | 232 | # Only runs on comments not done by the github actions bot |
| 204 | if: always() && (github.event_name == 'pull_request_review_comment' && github.event.sender.type != 'Bot') | 233 | if: always() && (github.event_name == 'pull_request_review_comment' && github.event.sender.type != 'Bot') |
| @@ -236,7 +265,7 @@ jobs: | |||
| 236 | 265 | ||
| 237 | check-merge-blocking-labels: | 266 | check-merge-blocking-labels: |
| 238 | name: 🚫 Check Merge Blocking Labels | 267 | name: 🚫 Check Merge Blocking Labels |
| 239 | needs: [label-by-branches, label-by-files, remove-stale-label] | 268 | needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label] |
| 240 | runs-on: ubuntu-latest | 269 | runs-on: ubuntu-latest |
| 241 | # Run, even if the previous jobs were skipped/failed | 270 | # Run, even if the previous jobs were skipped/failed |
| 242 | if: always() | 271 | if: always() |
| @@ -286,7 +315,7 @@ jobs: | |||
| 286 | 315 | ||
| 287 | write-auto-comments: | 316 | write-auto-comments: |
| 288 | name: 💬 Post PR Comments Based on Labels | 317 | name: 💬 Post PR Comments Based on Labels |
| 289 | needs: [label-by-branches, label-by-files, remove-stale-label, check-merge-blocking-labels] | 318 | needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label, check-merge-blocking-labels] |
| 290 | runs-on: ubuntu-latest | 319 | runs-on: ubuntu-latest |
| 291 | # Run, even if the previous jobs were skipped/failed | 320 | # Run, even if the previous jobs were skipped/failed |
| 292 | if: always() && (github.event_name == 'pull_request_target') | 321 | if: always() && (github.event_name == 'pull_request_target') |