]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
build: automatically add a thank you note on PR merge
authorDaniel Wagner <wagi@kernel.org>
Mon, 20 Jan 2025 09:05:24 +0000 (10:05 +0100)
committerDaniel Wagner <wagi@monom.org>
Mon, 20 Jan 2025 09:09:52 +0000 (10:09 +0100)
Be friendly and add a thank you note to all merged PRs. Currently, I
type it always by hand.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
.github/workflows/thanks.yml [new file with mode: 0644]

diff --git a/.github/workflows/thanks.yml b/.github/workflows/thanks.yml
new file mode 100644 (file)
index 0000000..fc5be9d
--- /dev/null
@@ -0,0 +1,26 @@
+name: Comment on Merged PR
+
+on:
+  pull_request:
+    types:
+      - closed
+
+jobs:
+  comment-on-merge:
+    if: github.event.pull_request.merged == true
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Comment on merged PR
+        uses: actions/github-script@v7
+        with:
+          script: |
+            const prNumber = context.payload.pull_request.number;
+            const comment = 'Thanks for your contribution!';
+
+            await github.issues.createComment({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              issue_number: prNumber,
+              body: comment,
+            });