Skip to content

Djim Schaap

Djim Schaap #4053

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']
});