name: agent-scan on: # zizmor: ignore[dangerous-triggers] needs write access to rename PRs from forks # DO NOT add actions/checkout in this workflow pull_request_target: types: - closed - labeled permissions: pull-requests: write jobs: rename: if: >- github.event.pull_request.state == 'closed' && !github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'possible bot') && (github.event.action == 'closed' || github.event.label.name == 'possible bot') runs-on: ubuntu-latest steps: - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | await github.rest.pulls.update({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.payload.pull_request.number, title: '🚨 unwelcome pr from bot 🚨', })