From a1bcfa1e639293006d564c50a9eb0debd9eb34ee Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 28 Jul 2025 21:27:45 -0400 Subject: [PATCH 01/24] use token for gh cli --- .github/workflows/verify-pull-request.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 49ff7395..82e1d31e 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -19,6 +19,8 @@ jobs: new_body="Closes #$issue_number" >> $body gh pr edit -b $new_body echo "Edited the body to include the issue number $issue_number" + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: find-linked-issues uses: Ismoh-Games/find-linked-issues@v1.0.6 with: @@ -42,23 +44,30 @@ jobs: first_issue=gh issue view ${{ steps.find-linked-issues.outputs.linked-issues[1] }} --json assignees --jq ' .assignees' echo "first_assignee=$(fromJson(first_issue)[1].login" >> "$GITHUB_OUTPUT" - + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Set PR assignee run: | gh pr edit ${{ github.event.pull_request.number }} \ --add-assignee ${{ steps.get-issue-assignee.outputs.first_assignee }} + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Declan if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'varunsingh87' }} run: | gh pr edit ${{ github.event.pull_request.number }} \ --add-reviewer "Datoneguy246" + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Varun if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'Datoneguy246' }} run: | gh pr edit ${{ github.event.pull_request.number }} \ --add-reviewer "varunsingh87" + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Announce Success if: ${{ steps.find-linked-issues.outputs.is-pull-request-linked-to-issues == 'True' }} From 67b9e048d3a8af99c53f39f92f93e2af3407be54 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 28 Jul 2025 21:40:09 -0400 Subject: [PATCH 02/24] use GH_TOKEN --- .github/workflows/verify-pull-request.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 8a6c2d61..d3705687 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -23,7 +23,7 @@ jobs: gh pr edit -b $new_body echo "Edited the body to include the issue number $issue_number" env: - token: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: find-linked-issues uses: Ismoh-Games/find-linked-issues@v1.0.6 with: @@ -48,13 +48,13 @@ jobs: .assignees' echo "first_assignee=$(fromJson(first_issue)[1].login" >> "$GITHUB_OUTPUT" env: - token: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR assignee run: | gh pr edit ${{ github.event.pull_request.number }} \ --add-assignee ${{ steps.get-issue-assignee.outputs.first_assignee }} env: - token: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Declan if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'varunsingh87' }} @@ -62,7 +62,7 @@ jobs: gh pr edit ${{ github.event.pull_request.number }} \ --add-reviewer "Datoneguy246" with: - token: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Varun if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'Datoneguy246' }} @@ -70,7 +70,7 @@ jobs: gh pr edit ${{ github.event.pull_request.number }} \ --add-reviewer "varunsingh87" env: - token: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Announce Success if: ${{ steps.find-linked-issues.outputs.is-pull-request-linked-to-issues == 'True' }} From ac3b09cb98724ca8f5964a1c898f340430d5d65f Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 28 Jul 2025 21:43:48 -0400 Subject: [PATCH 03/24] Remove checkout --- .github/workflows/verify-pull-request.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index d3705687..77b38f07 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -11,9 +11,6 @@ jobs: issues: read pull-requests: write steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: add-issue-to-body run: | # get the title, take the first word which should be the issue number, and add this to the body title=$(gh pr view ${{ github.event.pull_request.number }} --json title --jq '.title') From a358b3896d93cc10baa03a2b31ab8db60da80395 Mon Sep 17 00:00:00 2001 From: Varun Singh <31084854+varunsingh87@users.noreply.github.com> Date: Mon, 28 Jul 2025 21:46:23 -0400 Subject: [PATCH 04/24] Update verify-pull-request.yml --- .github/workflows/verify-pull-request.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index d3705687..77b38f07 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -11,9 +11,6 @@ jobs: issues: read pull-requests: write steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: add-issue-to-body run: | # get the title, take the first word which should be the issue number, and add this to the body title=$(gh pr view ${{ github.event.pull_request.number }} --json title --jq '.title') From 3df02f72a05bc2a1c68883154e138db4b22eee65 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 28 Jul 2025 21:49:54 -0400 Subject: [PATCH 05/24] fix with --- .github/workflows/verify-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 77b38f07..6f66629c 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -58,7 +58,7 @@ jobs: run: | gh pr edit ${{ github.event.pull_request.number }} \ --add-reviewer "Datoneguy246" - with: + env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Varun From 6dfa2bce2a34a98a8d13ae857405b123b2c02b5b Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 28 Jul 2025 22:01:11 -0400 Subject: [PATCH 06/24] read content --- .github/workflows/verify-pull-request.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 6f66629c..eae1857a 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -8,9 +8,15 @@ jobs: mirror-linked-issue: runs-on: ubuntu-latest # find-linked-issue GitHub Action is only supported on Linux permissions: + content: read issues: read pull-requests: write steps: + - name: Checkout repository + uses: actions/checkout@v4 + sparse-checkout: | + .github + - name: add-issue-to-body run: | # get the title, take the first word which should be the issue number, and add this to the body title=$(gh pr view ${{ github.event.pull_request.number }} --json title --jq '.title') From 5e2fc34ea093415517ce64c44ad42e1d7f55df1b Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 28 Jul 2025 22:02:25 -0400 Subject: [PATCH 07/24] contents --- .github/workflows/verify-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index eae1857a..dda266cf 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -8,7 +8,7 @@ jobs: mirror-linked-issue: runs-on: ubuntu-latest # find-linked-issue GitHub Action is only supported on Linux permissions: - content: read + contents: read issues: read pull-requests: write steps: From 0c7257fae3fbeb03709b6719d5efbf669d9c9923 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 28 Jul 2025 22:03:29 -0400 Subject: [PATCH 08/24] with --- .github/workflows/verify-pull-request.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index dda266cf..ad554994 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -14,8 +14,9 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - sparse-checkout: | - .github + with: + sparse-checkout: | + .github - name: add-issue-to-body run: | # get the title, take the first word which should be the issue number, and add this to the body From 78912d1601b65b58e044a3e1bb5b1b18f18a190b Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 28 Jul 2025 22:05:10 -0400 Subject: [PATCH 09/24] pull_request --- .github/workflows/verify-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index ad554994..e5a0dcbc 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -1,6 +1,6 @@ name: Verify Pull Request meets Requirements on: - pull_request_target: # need write permission + pull_request: # need write permission branches: - main types: [opened, edited] From 7a012312d91ec114101d0a163057da3352aac4e9 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Tue, 29 Jul 2025 21:07:48 -0400 Subject: [PATCH 10/24] Use correct BASH syntax for verify-pull-request workflow --- .github/workflows/verify-pull-request.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index e5a0dcbc..af1b117e 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -17,18 +17,20 @@ jobs: with: sparse-checkout: | .github + token: ${{ secrets.GITHUB_TOKEN }} - name: add-issue-to-body run: | # get the title, take the first word which should be the issue number, and add this to the body title=$(gh pr view ${{ github.event.pull_request.number }} --json title --jq '.title') - issue_number=$title[(ws: :)1] + issue_number=${title% *} body=$(gh pr view ${{ github.event.pull_request.number }} --json body --jq '.body') - new_body="Closes #$issue_number" >> $body - gh pr edit -b $new_body + echo new_body="Closes #$issue_number"$'\n\n'"$body + gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: find-linked-issues + - id: find-linked-issues + name: Find Linked Issues uses: Ismoh-Games/find-linked-issues@v1.0.6 with: token: ${{ secrets.GITHUB_TOKEN }} From 6ea89457bc12a001a88abb5c2cd880e6c5764eac Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Tue, 29 Jul 2025 21:14:15 -0400 Subject: [PATCH 11/24] Add missing quote --- .github/workflows/verify-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index c6b26800..e96e9ac0 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -23,7 +23,7 @@ jobs: title=$(gh pr view ${{ github.event.pull_request.number }} --json title --jq '.title') issue_number=${title% *} body=$(gh pr view ${{ github.event.pull_request.number }} --json body --jq '.body') - echo new_body="Closes #$issue_number"$'\n\n'"$body + echo new_body="Closes #$issue_number"$'\n\n'"$body" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" env: From 366a0feaa911c2842c257b21dbe0e9c9efb28341 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Tue, 29 Jul 2025 21:18:13 -0400 Subject: [PATCH 12/24] n --- .github/workflows/verify-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index e96e9ac0..226d3801 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -23,7 +23,7 @@ jobs: title=$(gh pr view ${{ github.event.pull_request.number }} --json title --jq '.title') issue_number=${title% *} body=$(gh pr view ${{ github.event.pull_request.number }} --json body --jq '.body') - echo new_body="Closes #$issue_number"$'\n\n'"$body" + new_body="Closes #$issue_number"$'\n\n'"$body" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" env: From ca3bad0604d93f2acdaafddb52ba0053ec8a0f0a Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Tue, 29 Jul 2025 21:22:31 -0400 Subject: [PATCH 13/24] Use new-body --- .github/workflows/verify-pull-request.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 226d3801..15e34440 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -18,14 +18,14 @@ jobs: sparse-checkout: | .github token: ${{ secrets.GITHUB_TOKEN }} - - name: add-issue-to-body + - id: add-issue-to-body + name: Add issue to body run: | # get the title, take the first word which should be the issue number, and add this to the body - title=$(gh pr view ${{ github.event.pull_request.number }} --json title --jq '.title') - issue_number=${title% *} - body=$(gh pr view ${{ github.event.pull_request.number }} --json body --jq '.body') - new_body="Closes #$issue_number"$'\n\n'"$body" + issue_number=${${{ github.event.pull_request.title }}% *} + new_body="Closes #$issue_number"$'\n\n'"${{ github.event.pull_request.body }}" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" + echo "new_body=$new_body" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: find-linked-issues @@ -35,7 +35,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} pull-request-number: ${{ github.event.pull_request.number }} - pull-request-body: ${{ github.event.pull_request.body }} + pull-request-body: ${{ steps.add-issue-to-body.outputs.new_body }} copy-issues-labels: true include-closed-issues: false From 09245fdb15ec3678444f256b10eefe61d312ecdb Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Tue, 29 Jul 2025 21:26:00 -0400 Subject: [PATCH 14/24] use variable --- .github/workflows/verify-pull-request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 15e34440..ea83eac7 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -21,7 +21,8 @@ jobs: - id: add-issue-to-body name: Add issue to body run: | # get the title, take the first word which should be the issue number, and add this to the body - issue_number=${${{ github.event.pull_request.title }}% *} + title=${{ github.event.pull_request.title }} + issue_number=${title% *} new_body="Closes #$issue_number"$'\n\n'"${{ github.event.pull_request.body }}" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" From b580e3142dc3724fdbc8fa7725c824c59c53e630 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Tue, 29 Jul 2025 21:27:41 -0400 Subject: [PATCH 15/24] Use ody --- .github/workflows/verify-pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index ea83eac7..fc91440f 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -21,7 +21,7 @@ jobs: - id: add-issue-to-body name: Add issue to body run: | # get the title, take the first word which should be the issue number, and add this to the body - title=${{ github.event.pull_request.title }} + title="${{ github.event.pull_request.title }}" issue_number=${title% *} new_body="Closes #$issue_number"$'\n\n'"${{ github.event.pull_request.body }}" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" @@ -36,7 +36,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} pull-request-number: ${{ github.event.pull_request.number }} - pull-request-body: ${{ steps.add-issue-to-body.outputs.new_body }} + pull-request-body: "${{ steps.add-issue-to-body.outputs.new_body }}" copy-issues-labels: true include-closed-issues: false From cbad034da9ee6f152597df986d1f0356a7c21ef4 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Tue, 29 Jul 2025 21:30:55 -0400 Subject: [PATCH 16/24] Use '' --- .github/workflows/verify-pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index fc91440f..59db7320 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -26,7 +26,7 @@ jobs: new_body="Closes #$issue_number"$'\n\n'"${{ github.event.pull_request.body }}" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" - echo "new_body=$new_body" >> "$GITHUB_OUTPUT" + echo "new_body='$new_body'" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: find-linked-issues @@ -52,7 +52,7 @@ jobs: run: | first_issue=gh issue view ${{ steps.find-linked-issues.outputs.linked-issues[1] }} --json assignees --jq ' .assignees' - echo "first_assignee=$(fromJson(first_issue)[1].login" >> "$GITHUB_OUTPUT" + echo "first_assignee=$(fromJson(first_issue)[1].login)" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR assignee From 046d956ecc6411af14a6db5a843e10d23991e168 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Tue, 29 Jul 2025 21:42:30 -0400 Subject: [PATCH 17/24] sss --- .github/workflows/verify-pull-request.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 59db7320..38105a4d 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -26,7 +26,9 @@ jobs: new_body="Closes #$issue_number"$'\n\n'"${{ github.event.pull_request.body }}" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" - echo "new_body='$new_body'" >> "$GITHUB_OUTPUT" + echo "new_body<> $GITHUB_OUTPUT + echo $new_body >> "$GITHUB_OUTPUT" + echo "EOF" >> $GITHUB_OUTPUT env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: find-linked-issues From 053fe54f0ff8ff3848ce187bec5f73a70b93e013 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Thu, 31 Jul 2025 21:10:31 -0400 Subject: [PATCH 18/24] Use a different action --- .github/workflows/verify-pull-request.yml | 40 +++++------------------ 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 38105a4d..b4953e25 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -19,40 +19,27 @@ jobs: .github token: ${{ secrets.GITHUB_TOKEN }} - id: add-issue-to-body - name: Add issue to body + name: Link issue in body run: | # get the title, take the first word which should be the issue number, and add this to the body title="${{ github.event.pull_request.title }}" issue_number=${title% *} new_body="Closes #$issue_number"$'\n\n'"${{ github.event.pull_request.body }}" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" - echo "new_body<> $GITHUB_OUTPUT - echo $new_body >> "$GITHUB_OUTPUT" - echo "EOF" >> $GITHUB_OUTPUT + echo "issue_number=$issue_number" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - id: find-linked-issues - name: Find Linked Issues - uses: Ismoh-Games/find-linked-issues@v1.0.6 + - id: copy-issue-labels + name: Copy Issue Labels + uses: michalvankodev/copy-issue-labels@v1.2.1 with: - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.repository }} - pull-request-number: ${{ github.event.pull_request.number }} - pull-request-body: "${{ steps.add-issue-to-body.outputs.new_body }}" - copy-issues-labels: true - include-closed-issues: false - - # Use the output from the `find-linked-issues` step - - name: Use the output - run: | - echo "is-pull-request-linked-to-issues: ${{ steps.find-linked-issues.outputs.is-pull-request-linked-to-issues }}" - echo "linked-issues: ${{ steps.find-linked-issues.outputs.linked-issues }}" - echo "pull-request-labels: ${{ steps.find-linked-issues.outputs.pull-request-labels }}" + repo-token: ${{ secrets.GITHUB_TOKEN }} + from-title: true - name: Get issue assignee id: get-issue-assignee run: | - first_issue=gh issue view ${{ steps.find-linked-issues.outputs.linked-issues[1] }} --json assignees --jq ' + first_issue=gh issue view ${{ steps.add-issue-to-body.outputs.issue_number }} --json assignees --jq ' .assignees' echo "first_assignee=$(fromJson(first_issue)[1].login)" >> "$GITHUB_OUTPUT" env: @@ -79,14 +66,3 @@ jobs: --add-reviewer "varunsingh87" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Announce Success - if: ${{ steps.find-linked-issues.outputs.is-pull-request-linked-to-issues == 'True' }} - run: | - echo "Pull request is linked to issues" - - - name: Announce Failure - if: ${{ steps.find-linked-issues.outputs.is-pull-request-linked-to-issues == 'False' }} - run: | - echo "::warning Pull request must have a linked issue before merging" - exit 1 From 5865f2ab9f9e42a99f2369b0f1c00ce5f2ebf8ec Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Thu, 31 Jul 2025 21:15:26 -0400 Subject: [PATCH 19/24] Fix get-issue-assignee --- .github/workflows/verify-pull-request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index b4953e25..6b34440a 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -39,9 +39,9 @@ jobs: - name: Get issue assignee id: get-issue-assignee run: | - first_issue=gh issue view ${{ steps.add-issue-to-body.outputs.issue_number }} --json assignees --jq ' - .assignees' - echo "first_assignee=$(fromJson(first_issue)[1].login)" >> "$GITHUB_OUTPUT" + first_assignee=$(gh issue view ${{ steps.add-issue-to-body.outputs.issue_number }} --json assignees --jq ' + .assignees[0].login') + echo "first_assignee=$first_assignee" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR assignee From 91b87f6b4bef45311af00f5497462c7c64c6d448 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Thu, 31 Jul 2025 21:17:06 -0400 Subject: [PATCH 20/24] Fix syntax error --- .github/workflows/verify-pull-request.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 6b34440a..0e04b82c 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -39,8 +39,9 @@ jobs: - name: Get issue assignee id: get-issue-assignee run: | - first_assignee=$(gh issue view ${{ steps.add-issue-to-body.outputs.issue_number }} --json assignees --jq ' - .assignees[0].login') + first_assignee=$(gh issue view ${{ steps.add-issue-to-body.outputs.issue_number }} \ + --json assignees \ + --jq '.assignees[0].login') echo "first_assignee=$first_assignee" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3a90ea6a630010864a302711ea904b58e7a23616 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Thu, 31 Jul 2025 21:31:33 -0400 Subject: [PATCH 21/24] use parameter expansion correctly --- .github/workflows/verify-pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 0e04b82c..12a483cc 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -22,7 +22,7 @@ jobs: name: Link issue in body run: | # get the title, take the first word which should be the issue number, and add this to the body title="${{ github.event.pull_request.title }}" - issue_number=${title% *} + issue_number=${title%% *} new_body="Closes #$issue_number"$'\n\n'"${{ github.event.pull_request.body }}" gh pr edit ${{ github.event.pull_request.number }} --body "$new_body" echo "Edited the body to include the issue number $issue_number" @@ -39,7 +39,7 @@ jobs: - name: Get issue assignee id: get-issue-assignee run: | - first_assignee=$(gh issue view ${{ steps.add-issue-to-body.outputs.issue_number }} \ + first_assignee=$(gh issue view "${{ steps.add-issue-to-body.outputs.issue_number }}" \ --json assignees \ --jq '.assignees[0].login') echo "first_assignee=$first_assignee" >> "$GITHUB_OUTPUT" From a557babdb6fbe5d3325bdd8e3f30bf07440f23cb Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Thu, 31 Jul 2025 21:34:28 -0400 Subject: [PATCH 22/24] fix syntax again --- .github/workflows/verify-pull-request.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 12a483cc..85cb5c0f 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -47,23 +47,23 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR assignee run: | - gh pr edit ${{ github.event.pull_request.number }} \ - --add-assignee ${{ steps.get-issue-assignee.outputs.first_assignee }} + gh pr edit ${{ github.event.pull_request.number }} --add-assignee \ + ${{ steps.get-issue-assignee.outputs.first_assignee }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Declan if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'varunsingh87' }} run: | - gh pr edit ${{ github.event.pull_request.number }} \ - --add-reviewer "Datoneguy246" + gh pr edit ${{ github.event.pull_request.number }} --add-reviewer \ + "Datoneguy246" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Varun if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'Datoneguy246' }} run: | - gh pr edit ${{ github.event.pull_request.number }} \ - --add-reviewer "varunsingh87" + gh pr edit ${{ github.event.pull_request.number }} --add-reviewer \ + "varunsingh87" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 15227ec65108665f9c774728d46b01828c0ff730 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Thu, 31 Jul 2025 21:35:56 -0400 Subject: [PATCH 23/24] a --- .github/workflows/verify-pull-request.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 85cb5c0f..270b1f6f 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -47,23 +47,20 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR assignee run: | - gh pr edit ${{ github.event.pull_request.number }} --add-assignee \ - ${{ steps.get-issue-assignee.outputs.first_assignee }} + gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ steps.get-issue-assignee.outputs.first_assignee }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Declan if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'varunsingh87' }} run: | - gh pr edit ${{ github.event.pull_request.number }} --add-reviewer \ - "Datoneguy246" + gh pr edit ${{ github.event.pull_request.number }} --add-reviewer "Datoneguy246" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Varun if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'Datoneguy246' }} run: | - gh pr edit ${{ github.event.pull_request.number }} --add-reviewer \ - "varunsingh87" + gh pr edit ${{ github.event.pull_request.number }} --add-reviewer "varunsingh87" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1f248088f3a08de54e61a5b1c964e4b25684e05e Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Thu, 31 Jul 2025 21:40:48 -0400 Subject: [PATCH 24/24] simplify simplify simplify --- .github/workflows/verify-pull-request.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify-pull-request.yml b/.github/workflows/verify-pull-request.yml index 270b1f6f..9efd718f 100644 --- a/.github/workflows/verify-pull-request.yml +++ b/.github/workflows/verify-pull-request.yml @@ -46,21 +46,19 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR assignee - run: | - gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ steps.get-issue-assignee.outputs.first_assignee }} + run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee "${{ env.ISSUE_ASSIGNEE }}" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_ASSIGNEE: ${{ steps.get-issue-assignee.outputs.first_assignee }} - name: Set PR reviewer to Declan if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'varunsingh87' }} - run: | - gh pr edit ${{ github.event.pull_request.number }} --add-reviewer "Datoneguy246" + run: gh pr edit ${{ github.event.pull_request.number }} --add-reviewer "Datoneguy246" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set PR reviewer to Varun if: ${{ steps.get-issue-assignee.outputs.first_assignee == 'Datoneguy246' }} - run: | - gh pr edit ${{ github.event.pull_request.number }} --add-reviewer "varunsingh87" + run: gh pr edit ${{ github.event.pull_request.number }} --add-reviewer "varunsingh87" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}