From d1a2170b9e15b6a49fa30738c46686f1f2ab6cca Mon Sep 17 00:00:00 2001 From: mkorwel Date: Thu, 18 Sep 2025 09:17:28 -0700 Subject: [PATCH 1/4] permissions --- .github/workflows/release-patch-from-comment.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-patch-from-comment.yml b/.github/workflows/release-patch-from-comment.yml index bfc51da8f9b..2ef1aade7b2 100644 --- a/.github/workflows/release-patch-from-comment.yml +++ b/.github/workflows/release-patch-from-comment.yml @@ -7,6 +7,10 @@ on: jobs: slash-command: runs-on: 'ubuntu-latest' + permissions: + contents: 'write' + pull-requests: 'write' + actions: 'write' steps: - name: 'Slash Command Dispatch' id: 'slash_command' From d59e3f81263a67c216c4d44495df7e2531c7ccf6 Mon Sep 17 00:00:00 2001 From: mkorwel Date: Thu, 18 Sep 2025 09:22:13 -0700 Subject: [PATCH 2/4] actually run steps --- .github/workflows/release-patch-from-comment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-patch-from-comment.yml b/.github/workflows/release-patch-from-comment.yml index 2ef1aade7b2..2b1313c7e83 100644 --- a/.github/workflows/release-patch-from-comment.yml +++ b/.github/workflows/release-patch-from-comment.yml @@ -25,7 +25,6 @@ jobs: - name: 'Get PR Status' id: 'pr_status' - if: "steps.slash_command.outputs.dispatched == 'true'" env: GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' run: | From d3520abb67247693c03f98d2f6789879d820c8b0 Mon Sep 17 00:00:00 2001 From: mkorwel Date: Thu, 18 Sep 2025 09:25:54 -0700 Subject: [PATCH 3/4] fix --- .github/workflows/release-patch-from-comment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-patch-from-comment.yml b/.github/workflows/release-patch-from-comment.yml index 2b1313c7e83..8fabb7527fc 100644 --- a/.github/workflows/release-patch-from-comment.yml +++ b/.github/workflows/release-patch-from-comment.yml @@ -25,6 +25,7 @@ jobs: - name: 'Get PR Status' id: 'pr_status' + if: "steps.slash_command.outputs.dispatched == 'true'" env: GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' run: | @@ -51,7 +52,7 @@ jobs: }) - name: 'Comment on Failure' - if: "steps.pr_status.outputs.STATE != 'MERGED'" + if: "steps.slash_command.outputs.dispatched == 'true' && steps.pr_status.outputs.STATE != 'MERGED'" uses: 'peter-evans/create-or-update-comment@67dcc547d311b736a8e6c5c236542148a47adc3d' with: issue-number: '${{ github.event.issue.number }}' From 3ae6e858044bbaa06fb1e0a34a63264bce4393a7 Mon Sep 17 00:00:00 2001 From: mkorwel Date: Thu, 18 Sep 2025 09:29:31 -0700 Subject: [PATCH 4/4] again --- .github/workflows/release-patch-from-comment.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/release-patch-from-comment.yml b/.github/workflows/release-patch-from-comment.yml index 8fabb7527fc..c1f869f00b2 100644 --- a/.github/workflows/release-patch-from-comment.yml +++ b/.github/workflows/release-patch-from-comment.yml @@ -12,6 +12,11 @@ jobs: pull-requests: 'write' actions: 'write' steps: + - name: 'Checkout' + uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + with: + fetch-depth: 1 + - name: 'Slash Command Dispatch' id: 'slash_command' uses: 'peter-evans/slash-command-dispatch@40877f718dce0101edfc7aea2b3800cc192f9ed5' @@ -23,6 +28,16 @@ jobs: static-args: | dry_run=false + - name: 'Acknowledge Patch Command' + if: "steps.slash_command.outputs.dispatched == 'true'" + uses: 'peter-evans/create-or-update-comment@67dcc547d311b736a8e6c5c236542148a47adc3d' + with: + issue-number: '${{ github.event.issue.number }}' + body: | + 👋 Patch command received! Processing... + + You can track the progress here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + - name: 'Get PR Status' id: 'pr_status' if: "steps.slash_command.outputs.dispatched == 'true'"