]> git.kaiwu.me - nginx.git/commitdiff
GH: post a new issue welcome comment
authorAndrew Clayton <a.clayton@nginx.com>
Wed, 4 Mar 2026 18:42:07 +0000 (18:42 +0000)
committerAndrew Clayton <a.clayton@nginx.com>
Fri, 24 Apr 2026 16:33:41 +0000 (17:33 +0100)
Whenever a new issue is created in GitHub, post a "welcome" message as a
comment.

.github/workflows/new-issue-welcome.yaml [new file with mode: 0644]

diff --git a/.github/workflows/new-issue-welcome.yaml b/.github/workflows/new-issue-welcome.yaml
new file mode 100644 (file)
index 0000000..45e3e16
--- /dev/null
@@ -0,0 +1,32 @@
+name: New Issue Welcome
+
+on:
+  issues:
+    types: [opened]
+
+jobs:
+  new-issue-welcome:
+    runs-on: ubuntu-24.04
+    permissions:
+      issues: write
+
+    steps:
+      - name: Comment on new issue
+        uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          script: |
+            const issueNumber = context.issue.number;
+            const username = context.payload.issue.user.login;
+
+            const comment = [
+              `👋 Thanks for opening this issue and contributing to the NGINX project!`,
+              `A maintainer will review it and follow up when possible. We appreciate your support.`
+            ].join('\n');
+
+            await github.rest.issues.createComment({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              issue_number: issueNumber,
+              body: comment
+            });