Djim Schaap #4053
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Add bench label from comment | |
| on: | |
| issue_comment: | |
| types: [created] | |
| concurrency: | |
| group: bench-label-${{ github.event.issue.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| add-label: | |
| if: > | |
| github.event.issue.pull_request | |
| && github.event.comment.body == '/bench' | |
| && github.event.comment.user.id == github.event.issue.user.id | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Add "bench_needed" label | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const labels = context.payload.issue.labels.map(l => l.name); | |
| if (labels.includes('bench_needed')) { | |
| core.info('Label "bench_needed" already present, skipping.'); | |
| return; | |
| } | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| labels: ['bench_needed'] | |
| }); |