okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge branch 'f-020-reset' into f-020-intf57c0adcb

main
2.0 KiB58 linesraw
1name: Intake
2
3# New issues and pull requests that do not follow CONTRIBUTING.md get the needs-format label and one friendly note.
4# Items that keep the label for 5 days are closed by the daily sweep, with a note on how to /reopen.
5#
6# pull_request_target is used instead of pull_request on purpose: a pull request from a fork gets a read-only
7# GITHUB_TOKEN under pull_request, so it could not be labelled or commented on. It is safe here because this
8# workflow never checks out or runs the pull request's code. It checks out the default branch only (the bot
9# scripts) and reads the title and description from the event payload and the REST API.
10
11on:
12  issues:
13    types: [opened, edited]
14  pull_request_target:
15    types: [opened, edited]
16  schedule:
17    - cron: '17 4 * * *'
18  workflow_dispatch:
19
20permissions:
21  contents: read
22  issues: write
23  pull-requests: write
24
25concurrency:
26  group: intake-${{ github.event.issue.number || github.event.pull_request.number || 'sweep' }}
27  cancel-in-progress: false
28
29jobs:
30  check:
31    if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
32    runs-on: ubuntu-latest
33    steps:
34      - uses: actions/checkout@v4
35        with:
36          ref: ${{ github.event.repository.default_branch }}
37          sparse-checkout: .github/scripts
38          persist-credentials: false
39      - uses: actions/github-script@v7
40        with:
41          script: |
42            const bot = require('./.github/scripts/reset-bot.js');
43            await bot.intake({ github, context, core });
44
45  sweep:
46    if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
47    runs-on: ubuntu-latest
48    steps:
49      - uses: actions/checkout@v4
50        with:
51          ref: ${{ github.event.repository.default_branch }}
52          sparse-checkout: .github/scripts
53          persist-credentials: false
54      - uses: actions/github-script@v7
55        with:
56          script: |
57            const bot = require('./.github/scripts/reset-bot.js');
58            await bot.sweep({ github, context, core });