name: Intake # New issues and pull requests that do not follow CONTRIBUTING.md get the needs-format label and one friendly note. # Items that keep the label for 5 days are closed by the daily sweep, with a note on how to /reopen. # # pull_request_target is used instead of pull_request on purpose: a pull request from a fork gets a read-only # GITHUB_TOKEN under pull_request, so it could not be labelled or commented on. It is safe here because this # workflow never checks out or runs the pull request's code. It checks out the default branch only (the bot # scripts) and reads the title and description from the event payload and the REST API. on: issues: types: [opened, edited] pull_request_target: types: [opened, edited] schedule: - cron: '17 4 * * *' workflow_dispatch: permissions: contents: read issues: write pull-requests: write concurrency: group: intake-${{ github.event.issue.number || github.event.pull_request.number || 'sweep' }} cancel-in-progress: false jobs: check: if: github.event_name == 'issues' || github.event_name == 'pull_request_target' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.repository.default_branch }} sparse-checkout: .github/scripts persist-credentials: false - uses: actions/github-script@v7 with: script: | const bot = require('./.github/scripts/reset-bot.js'); await bot.intake({ github, context, core }); sweep: if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.repository.default_branch }} sparse-checkout: .github/scripts persist-credentials: false - uses: actions/github-script@v7 with: script: | const bot = require('./.github/scripts/reset-bot.js'); await bot.sweep({ github, context, core });