okami.mom/strata

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

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

main
1.3 KiB38 linesraw
1name: Reopen
2
3# An author comments /reopen on their closed issue or pull request. The check runs and the item is reopened,
4# or the bot replies with what is still missing. GitHub does not let authors reopen items a maintainer closed,
5# so this workflow does it for them.
6#
7# issue_comment always runs the workflow file from the default branch with a write-capable token, which is what
8# we need for fork authors too. It never checks out or executes the pull request's code: it reads the live
9# title and description through the REST API. Only the author of the item or a maintainer can trigger it.
10
11on:
12  issue_comment:
13    types: [created]
14
15permissions:
16  contents: read
17  issues: write
18  pull-requests: write
19
20concurrency:
21  group: reopen-${{ github.event.issue.number }}
22  cancel-in-progress: false
23
24jobs:
25  reopen:
26    if: startsWith(github.event.comment.body, '/reopen') && github.event.comment.user.type != 'Bot'
27    runs-on: ubuntu-latest
28    steps:
29      - uses: actions/checkout@v4
30        with:
31          ref: ${{ github.event.repository.default_branch }}
32          sparse-checkout: .github/scripts
33          persist-credentials: false
34      - uses: actions/github-script@v7
35        with:
36          script: |
37            const bot = require('./.github/scripts/reset-bot.js');
38            await bot.reopen({ github, context, core });