From bdac7f42baedcab3ab16e24832197262e7512323 Mon Sep 17 00:00:00 2001 From: Felix Schneider <99918022+trueberryless@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:05:22 +0100 Subject: [PATCH 1/6] feat: welcome first contributors when PR opens --- .github/workflows/welcome.yml | 57 +++++++++-------------------------- 1 file changed, 15 insertions(+), 42 deletions(-) diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml index e4d0ec535a..1bfd8f8859 100644 --- a/.github/workflows/welcome.yml +++ b/.github/workflows/welcome.yml @@ -1,52 +1,25 @@ -name: welcome +name: Welcome on: pull_request_target: - types: - - closed + branches: [main] + types: [opened] -permissions: {} +permissions: + pull-requests: write jobs: - welcome: - permissions: - pull-requests: write # to comment on PRs - if: github.repository == 'npmx-dev/npmx.dev' && github.event.pull_request.merged == true - runs-on: ubuntu-slim - name: πŸŽ‰ Welcome new contributor + greeting: + name: Greet First-Time Contributors + if: github.repository == 'npmx-dev/npmx.dev' + runs-on: ubuntu-latest + steps: - - name: πŸŽ‰ Welcome new contributor - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + - uses: actions/first-interaction@1c4688942c71f71d4f5502a26ea67c331730fa4d # v3.1.0 with: - script: | - const pr = context.payload.pull_request; - const author = pr.user.login; - - // Check if this is the author's first merged PR - const { data: prs } = await github.rest.search.issuesAndPullRequests({ - q: `repo:${context.repo.owner}/${context.repo.repo} type:pr is:merged author:${author}`, - }); - - // If the only merged PR is this one, it's their first contribution - if (prs.total_count !== 1) { - console.log(`@${author} already has ${prs.total_count} merged PRs β€” skipping welcome comment.`); - return; - } - - const emojis = ['πŸŽ‰', 'πŸ₯³', '🎊', 'πŸš€', '⭐', 'πŸ’«', '✨', 'πŸ’ͺ', 'πŸ‘', 'πŸ™Œ', '🀩', 'πŸ’₯']; - const emoji = emojis[Math.floor(Math.random() * emojis.length)]; - - const body = [ - `Thanks for your first contribution, @${author}! ${emoji}`, - '', - `We'd love to welcome you to the npmx community. Come and say hi on [Discord](https://chat.npmx.dev)! And once you've joined, visit [npmx.wamellow.com](https://npmx.wamellow.com/) to claim the **contributor** role.`, - ].join('\n'); + pr_message: | + Thanks for your first contribution, @${{ github.event.pull_request.user.login }}! πŸš€ - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr.number, - body, - }); + We'd love to welcome you to the npmx community. While you wait for a review, come and say hi on [Discord](https://chat.npmx.dev)! - console.log(`Welcomed new contributor @${author} on PR #${pr.number}`); + Once your pull request is merged, you'll be able to visit [npmx.wamellow.com](https://npmx.wamellow.com/) to claim your **contributor** role. πŸš€ From b74bd81f04398f226495d3a65d441531f494ae84 Mon Sep 17 00:00:00 2001 From: Felix Schneider <99918022+trueberryless@users.noreply.github.com> Date: Mon, 23 Mar 2026 17:40:49 +0100 Subject: [PATCH 2/6] feat: introduce second workflow for welcoming message and adapt merged contribution workflow --- .github/workflows/welcome-close.yml | 52 +++++++++++++++++++++++++++++ .github/workflows/welcome-open.yml | 32 ++++++++++++++++++ .github/workflows/welcome.yml | 25 -------------- 3 files changed, 84 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/welcome-close.yml create mode 100644 .github/workflows/welcome-open.yml delete mode 100644 .github/workflows/welcome.yml diff --git a/.github/workflows/welcome-close.yml b/.github/workflows/welcome-close.yml new file mode 100644 index 0000000000..606f691bc6 --- /dev/null +++ b/.github/workflows/welcome-close.yml @@ -0,0 +1,52 @@ +name: Claim Contributor Message + +on: + pull_request_target: + types: + - closed + +permissions: {} + +jobs: + welcome: + permissions: + pull-requests: write # to comment on PRs + if: github.repository == 'npmx-dev/npmx.dev' && github.event.pull_request.merged == true + runs-on: ubuntu-slim + name: πŸŽ‰ Welcome new contributor + steps: + - name: πŸŽ‰ Welcome new contributor + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: | + const pr = context.payload.pull_request; + const author = pr.user.login; + + // Check if this is the author's first merged PR + const { data: prs } = await github.rest.search.issuesAndPullRequests({ + q: `repo:${context.repo.owner}/${context.repo.repo} type:pr is:merged author:${author}`, + }); + + // If the only merged PR is this one, it's their first contribution + if (prs.total_count !== 1) { + console.log(`@${author} already has ${prs.total_count} merged PRs β€” skipping welcome comment.`); + return; + } + + const emojis = ['πŸŽ‰', 'πŸ₯³', '🎊', 'πŸš€', '⭐', 'πŸ’«', '✨', 'πŸ’ͺ', 'πŸ‘', 'πŸ™Œ', '🀩', 'πŸ’₯']; + const emoji = emojis[Math.floor(Math.random() * emojis.length)]; + + const body = [ + `Thanks for your first contribution, @${author}! ${emoji}`, + '', + `We'd love to welcome you to the npmx community. Come and say hi on [Discord](https://chat.npmx.dev)! And once you've joined, visit [npmx.wamellow.com](https://npmx.wamellow.com/) to claim the **contributor** role.`, + ].join('\n'); + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + body, + }); + + console.log(`Welcomed new contributor @${author} on PR #${pr.number}`); diff --git a/.github/workflows/welcome-open.yml b/.github/workflows/welcome-open.yml new file mode 100644 index 0000000000..5510171355 --- /dev/null +++ b/.github/workflows/welcome-open.yml @@ -0,0 +1,32 @@ +name: Welcome Message + +on: + pull_request_target: + branches: [main] + types: [opened] + +permissions: + pull-requests: write + +jobs: + greeting: + name: Greet First-Time Contributors + if: github.repository == 'npmx-dev/npmx.dev' + runs-on: ubuntu-latest + + steps: + - uses: actions/first-interaction@1c4688942c71f71d4f5502a26ea67c331730fa4d # v3.1.0 + with: + pr_message: | + Hello! Thank you for opening your **first PR** to npmx, @${{ github.event.pull_request.user.login }}! πŸš€ + + Here’s what will happen next: + + 1. Our GitHub bots will run to check your changes. + If they spot any issues you will see some error messages on this PR. + Don’t hesitate to ask any questions if you’re not sure what these mean! + + 2. In a few minutes, you’ll be able to see a preview of your changes on Vercel 🀩 + + 3. One or more of our maintainers will take a look and may ask you to make changes. + We try to be responsive, but don’t worry if this takes a few days. diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml deleted file mode 100644 index 1bfd8f8859..0000000000 --- a/.github/workflows/welcome.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Welcome - -on: - pull_request_target: - branches: [main] - types: [opened] - -permissions: - pull-requests: write - -jobs: - greeting: - name: Greet First-Time Contributors - if: github.repository == 'npmx-dev/npmx.dev' - runs-on: ubuntu-latest - - steps: - - uses: actions/first-interaction@1c4688942c71f71d4f5502a26ea67c331730fa4d # v3.1.0 - with: - pr_message: | - Thanks for your first contribution, @${{ github.event.pull_request.user.login }}! πŸš€ - - We'd love to welcome you to the npmx community. While you wait for a review, come and say hi on [Discord](https://chat.npmx.dev)! - - Once your pull request is merged, you'll be able to visit [npmx.wamellow.com](https://npmx.wamellow.com/) to claim your **contributor** role. πŸš€ From 9cd00d5ccdc0911568a077fdcb36591196684e71 Mon Sep 17 00:00:00 2001 From: Felix Schneider <99918022+trueberryless@users.noreply.github.com> Date: Mon, 23 Mar 2026 17:43:59 +0100 Subject: [PATCH 3/6] fix: use fork action because original has some required issue https://github.com/actions/first-interaction/pull/404 --- .github/workflows/welcome-open.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/welcome-open.yml b/.github/workflows/welcome-open.yml index 5510171355..a411faa13d 100644 --- a/.github/workflows/welcome-open.yml +++ b/.github/workflows/welcome-open.yml @@ -15,9 +15,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/first-interaction@1c4688942c71f71d4f5502a26ea67c331730fa4d # v3.1.0 + - uses: zephyrproject-rtos/action-first-interaction@58853996b1ac504b8e0f6964301f369d2bb22e5c with: - pr_message: | + pr-opened-message: | Hello! Thank you for opening your **first PR** to npmx, @${{ github.event.pull_request.user.login }}! πŸš€ Here’s what will happen next: From 521f5585b442d636d69de02b7c2b72edeec4b499 Mon Sep 17 00:00:00 2001 From: "Willow (GHOST)" Date: Mon, 23 Mar 2026 15:54:42 -0700 Subject: [PATCH 4/6] chore: fmt --- .github/workflows/welcome-open.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/welcome-open.yml b/.github/workflows/welcome-open.yml index a411faa13d..26f365c53e 100644 --- a/.github/workflows/welcome-open.yml +++ b/.github/workflows/welcome-open.yml @@ -13,7 +13,6 @@ jobs: name: Greet First-Time Contributors if: github.repository == 'npmx-dev/npmx.dev' runs-on: ubuntu-latest - steps: - uses: zephyrproject-rtos/action-first-interaction@58853996b1ac504b8e0f6964301f369d2bb22e5c with: From f7ad8ca2f8535c05f39b96c87e88250aac5f154c Mon Sep 17 00:00:00 2001 From: "Willow (GHOST)" Date: Mon, 23 Mar 2026 15:58:18 -0700 Subject: [PATCH 5/6] chore: tweak wording --- .github/workflows/welcome-open.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/welcome-open.yml b/.github/workflows/welcome-open.yml index 26f365c53e..0c3ffdccdb 100644 --- a/.github/workflows/welcome-open.yml +++ b/.github/workflows/welcome-open.yml @@ -25,7 +25,9 @@ jobs: If they spot any issues you will see some error messages on this PR. Don’t hesitate to ask any questions if you’re not sure what these mean! - 2. In a few minutes, you’ll be able to see a preview of your changes on Vercel 🀩 + 2. In a few minutes, you’ll be able to see a preview of your changes on Vercel 3. One or more of our maintainers will take a look and may ask you to make changes. We try to be responsive, but don’t worry if this takes a few days. + + Please feel free to ask any questions you may have! From bf5396d91cfca16adc3a20ad38fafa0f0db6d6b5 Mon Sep 17 00:00:00 2001 From: "Willow (GHOST)" Date: Mon, 23 Mar 2026 23:37:54 -0700 Subject: [PATCH 6/6] fix: buy glasses --- .github/workflows/welcome-open.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/welcome-open.yml b/.github/workflows/welcome-open.yml index 0c3ffdccdb..625bf7dcb2 100644 --- a/.github/workflows/welcome-open.yml +++ b/.github/workflows/welcome-open.yml @@ -29,5 +29,3 @@ jobs: 3. One or more of our maintainers will take a look and may ask you to make changes. We try to be responsive, but don’t worry if this takes a few days. - - Please feel free to ask any questions you may have!