From fc7b9b1db932a7ad2e8e5c9a5ae6316aa788cb34 Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 10:33:20 -0500 Subject: [PATCH 01/10] feat: add dummy 1 branch --- dummy.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 dummy.md diff --git a/dummy.md b/dummy.md new file mode 100644 index 0000000..4c00198 --- /dev/null +++ b/dummy.md @@ -0,0 +1 @@ +The branch that this file was committed in is to allow you to create a testing PR. This commit/PR should NOT be merged From 84df745d832dd6c55332e6d38df47afa03468693 Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 10:48:15 -0500 Subject: [PATCH 02/10] Change permissions from issues to pull-requests --- .github/workflows/declined-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index 81c7012..ff77e4e 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -8,7 +8,7 @@ jobs: if: "github.event.label.name == 'status: declined'" runs-on: ubuntu-latest permissions: - issues: write + pull-requests: write steps: - name: Add comment run: gh pr comment "$NUMBER" --body "$BODY" From 842cfd38c65051c3f4daec74c4b19bd0b983ee10 Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 10:50:23 -0500 Subject: [PATCH 03/10] Change BODY variable to block scalar format Updated the BODY variable in the declined PR workflow to use a block scalar for better formatting. --- .github/workflows/declined-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index ff77e4e..ca85f2e 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -16,7 +16,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.pull_request.number }} - BODY: > + BODY: | Thank you for your contribution! However, we won't be merging this PR for at least one of these reasons: - The issue this PR resolves is reserved for new recruits. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). - This PR uses AI excessively. Please see Nebula Lab's [AI Policy](https://nebula-labs.atlassian.net/wiki/x/AgCwQw). From dc51741665b9b89fd795f3b37bddb0cbb53f023c Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 12:04:46 -0500 Subject: [PATCH 04/10] feat: unlink issues step for declining PR --- .github/workflows/declined-pr.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index ca85f2e..bb8566c 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -21,3 +21,28 @@ jobs: - The issue this PR resolves is reserved for new recruits. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). - This PR uses AI excessively. Please see Nebula Lab's [AI Policy](https://nebula-labs.atlassian.net/wiki/x/AgCwQw). - We plan to approach this issue in another way. + unlink-issue: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Remove closing keywords + uses: actions/github-script@v9 + with: + script: | + const prBody = context.payload.pull_request?.body ?? '' + const regex = /(close(s|d)?|fix(es|ed)?|resolve(s|d)?) ?(.+\/.+)?#\d+/gi + + if (regex.test(prBody)) { + const newBody = prBody.replace(regex, '') + + await github.rest.pulls.update({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request?.number ?? 0, + body: newBody + }) + core.info('Successfully removed closing keywords from PR description') + } else { + core.info("Couldn't find closing keywords to remove") + } From 25e3d18224fb9157273db84d0e6cf0a28b435154 Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 12:23:22 -0500 Subject: [PATCH 05/10] feat: surround with backticks rather than outright delete --- .github/workflows/declined-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index bb8566c..db110b4 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -34,7 +34,7 @@ jobs: const regex = /(close(s|d)?|fix(es|ed)?|resolve(s|d)?) ?(.+\/.+)?#\d+/gi if (regex.test(prBody)) { - const newBody = prBody.replace(regex, '') + const newBody = prBody.replace(regex, `\`&$\``) await github.rest.pulls.update({ owner: context.repo.owner, From 9e601ac367d73b9a60cc3434de79b7ff1989656b Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 12:40:46 -0500 Subject: [PATCH 06/10] what an amazing typo --- .github/workflows/declined-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index db110b4..0cf99e7 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -34,7 +34,7 @@ jobs: const regex = /(close(s|d)?|fix(es|ed)?|resolve(s|d)?) ?(.+\/.+)?#\d+/gi if (regex.test(prBody)) { - const newBody = prBody.replace(regex, `\`&$\``) + const newBody = prBody.replace(regex, `\`$&\``) await github.rest.pulls.update({ owner: context.repo.owner, From fb373154132be11fb02e6c9ac4b9b81963c97933 Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 13:01:12 -0500 Subject: [PATCH 07/10] feat: test closing PR --- .github/workflows/declined-pr.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index 0cf99e7..f42ab16 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -17,7 +17,7 @@ jobs: GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.pull_request.number }} BODY: | - Thank you for your contribution! However, we won't be merging this PR for at least one of these reasons: + (add-comment) Thank you for your contribution! However, we won't be merging this PR for at least one of these reasons: - The issue this PR resolves is reserved for new recruits. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). - This PR uses AI excessively. Please see Nebula Lab's [AI Policy](https://nebula-labs.atlassian.net/wiki/x/AgCwQw). - We plan to approach this issue in another way. @@ -46,3 +46,19 @@ jobs: } else { core.info("Couldn't find closing keywords to remove") } + close-pr: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Close PR + run: gh pr close "$NUMBER" --comment "$COMMENT" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.pull_request.number }} + COMMENT: | + Thank you for your contribution! However, we won't be merging this PR for at least one of these reasons: + - The issue this PR resolves is reserved for new recruits. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). + - This PR uses AI excessively. Please see Nebula Lab's [AI Policy](https://nebula-labs.atlassian.net/wiki/x/AgCwQw). + - We plan to approach this issue in another way. From 7927e3b74f4b4bbc4dfcf8160cc2a17ff9c9adcf Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 13:11:32 -0500 Subject: [PATCH 08/10] feat: add missing conditionals, rewrite comment --- .github/workflows/declined-pr.yml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index f42ab16..a48d89c 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -1,27 +1,11 @@ -name: Add comment +name: Decline PR on: pull_request: types: - labeled jobs: - add-comment: - if: "github.event.label.name == 'status: declined'" - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Add comment - run: gh pr comment "$NUMBER" --body "$BODY" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - NUMBER: ${{ github.event.pull_request.number }} - BODY: | - (add-comment) Thank you for your contribution! However, we won't be merging this PR for at least one of these reasons: - - The issue this PR resolves is reserved for new recruits. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). - - This PR uses AI excessively. Please see Nebula Lab's [AI Policy](https://nebula-labs.atlassian.net/wiki/x/AgCwQw). - - We plan to approach this issue in another way. unlink-issue: + if: "github.event.label.name == 'status: declined'" runs-on: ubuntu-latest permissions: pull-requests: write @@ -47,6 +31,7 @@ jobs: core.info("Couldn't find closing keywords to remove") } close-pr: + if: "github.event.label.name == 'status: declined'" runs-on: ubuntu-latest permissions: pull-requests: write @@ -58,7 +43,10 @@ jobs: GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.pull_request.number }} COMMENT: | - Thank you for your contribution! However, we won't be merging this PR for at least one of these reasons: - - The issue this PR resolves is reserved for new recruits. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). - - This PR uses AI excessively. Please see Nebula Lab's [AI Policy](https://nebula-labs.atlassian.net/wiki/x/AgCwQw). + Thank you for your contribution! However, we've closed this PR for at least one of these reasons: + + - The issue this PR resolves is reserved for new recruits in Nebula Labs. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). + - This PR uses AI in a way that breaks the [Nebula Labs AI Policy](https://nebula-labs.atlassian.net/wiki/x/AgCwQw). - We plan to approach this issue in another way. + + Please let us know if you have any questions. From 49f0b62882d9b60c36595c9dcc0d5a66c8c272b7 Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 13:21:30 -0500 Subject: [PATCH 09/10] feat: tweak comment --- .github/workflows/declined-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index a48d89c..8cbef36 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -45,8 +45,8 @@ jobs: COMMENT: | Thank you for your contribution! However, we've closed this PR for at least one of these reasons: - - The issue this PR resolves is reserved for new recruits in Nebula Labs. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). + - The issue this PR resolves is reserved for new recruits. You should instead find issues to work on using [these search filters](${{ github.server_url }}/${{ github.repository }}/issues?q=is%3Aissue%20state%3Aopen%20-label%3A%22Recommended%20for%20Recruits%22). - This PR uses AI in a way that breaks the [Nebula Labs AI Policy](https://nebula-labs.atlassian.net/wiki/x/AgCwQw). - We plan to approach this issue in another way. - Please let us know if you have any questions. + Please let us know if you have any questions! From 1d4dc763250f7e7476901d5cfd6f1d973f57642e Mon Sep 17 00:00:00 2001 From: Isoscelestial Date: Thu, 10 Sep 2026 13:30:09 -0500 Subject: [PATCH 10/10] feat: negative lookarounds for backticks, to avoid spamming backticks when adding/removing label multiple times --- .github/workflows/declined-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/declined-pr.yml b/.github/workflows/declined-pr.yml index 8cbef36..01d782d 100644 --- a/.github/workflows/declined-pr.yml +++ b/.github/workflows/declined-pr.yml @@ -15,7 +15,7 @@ jobs: with: script: | const prBody = context.payload.pull_request?.body ?? '' - const regex = /(close(s|d)?|fix(es|ed)?|resolve(s|d)?) ?(.+\/.+)?#\d+/gi + const regex = /(?