From 2cd037108d6b189fcc0ac4ed940426dbdfe2b540 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Wed, 23 Sep 2026 17:07:28 -0300 Subject: [PATCH 1/2] fix(ci): use shared first merged PR comment action Signed-off-by: Vitor Mattos --- .github/workflows/contributor-feedback.yml | 72 ------------------- .github/workflows/first-merged-pr-comment.yml | 62 ++++++++++++++++ 2 files changed, 62 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/contributor-feedback.yml create mode 100644 .github/workflows/first-merged-pr-comment.yml diff --git a/.github/workflows/contributor-feedback.yml b/.github/workflows/contributor-feedback.yml deleted file mode 100644 index 05c9f215ad..0000000000 --- a/.github/workflows/contributor-feedback.yml +++ /dev/null @@ -1,72 +0,0 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -name: Contributor feedback - -# A contributor's first *merged* pull request is the moment worth marking, not -# their first opened one -- someone may have had an earlier pull request closed -# without being accepted, and greeting that as a success reads wrong. -on: - pull_request_target: - types: [closed] - -permissions: {} - -concurrency: - group: contributor-feedback-${{ github.event.pull_request.number }} - cancel-in-progress: false - -jobs: - first-merged-contribution: - runs-on: ubuntu-latest - timeout-minutes: 10 - if: >- - github.event.pull_request.merged == true && - github.event.pull_request.user.type != 'Bot' - permissions: - contents: read - pull-requests: read - issues: write - - # Built here rather than inside the message, so the separator logic is - # readable and the message stays prose. The survey base URL is a - # repository variable the LibreCode team sets; only the two context - # values #8292 allows are appended, and `?` becomes `&` if the - # configured URL already carries a query string -- a LimeSurvey link - # often does (`/index.php?r=survey/index&sid=...`). - env: - SURVEY_LINK: >- - ${{ vars.CONTRIBUTOR_SURVEY_URL && format('{0}{1}source=github-first-merged-pr&repository={2}', - vars.CONTRIBUTOR_SURVEY_URL, - contains(vars.CONTRIBUTOR_SURVEY_URL, '?') && '&' || '?', - github.event.repository.name) || '' }} - - steps: - # Nothing from the pull request is checked out, downloaded or executed: - # pull_request_target runs with a writable token against the base - # repository, so the job only ever reads event metadata and posts a - # comment. - - name: Greet a first merged contribution - uses: zephyrproject-rtos/action-first-interaction@58853996b1ac504b8e0f6964301f369d2bb22e5c # v1.1.1+zephyr.6 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - pr-merged-message: > - Hi @${{ github.event.pull_request.user.login }}, your first pull - request to LibreSign has been merged. 🎉 - - - Your work is part of LibreSign now, and everyone who signs a - document with it benefits from the time and knowledge you shared. - Thank you. - - - You are very welcome to contribute again — the - [good first issue](https://github.com/LibreSign/libresign/labels/good%20first%20issue) - list is a good place to look next, and you no longer have to wonder - how the process works. - - - ${{ env.SURVEY_LINK && format('If you have a few minutes and feel like it, we would love to hear how this went for you: {0}. It is entirely optional — nothing is expected of you in return for contributing.', env.SURVEY_LINK) || '' }} - - - ${{ vars.COMMUNITY_URL && format('Come say hello in the LibreSign community: {0}', vars.COMMUNITY_URL) || '' }} diff --git a/.github/workflows/first-merged-pr-comment.yml b/.github/workflows/first-merged-pr-comment.yml new file mode 100644 index 0000000000..bcbb42aaf6 --- /dev/null +++ b/.github/workflows/first-merged-pr-comment.yml @@ -0,0 +1,62 @@ +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: First merged PR comment + +on: + pull_request_target: + types: [closed] + workflow_dispatch: + inputs: + pull_request_number: + description: Pull request number to process or retry + required: true + type: string + +permissions: {} + +concurrency: + group: >- + first-merged-pr-comment-${{ + github.event.pull_request.number || + inputs.pull_request_number || + github.run_id + }} + cancel-in-progress: false + +jobs: + first-merged-pr-comment: + if: >- + github.event_name == 'workflow_dispatch' || + ( + github.event.pull_request.merged == true && + github.event.pull_request.user.type != 'Bot' + ) + runs-on: ubuntu-latest + timeout-minutes: 5 + + permissions: + pull-requests: write + + env: + FIRST_MERGED_PR_MESSAGE: | + Hi {contributor_mention}, your first pull request to LibreSign has been merged. 🎉 + + Your work is part of LibreSign now, and everyone who signs a document with it benefits from the time and knowledge you shared. Thank you. + + You are very welcome to contribute again. The [good first issue]({repository_url}/labels/good%20first%20issue) list is a good place to look next, and you no longer have to wonder how the process works. + + If you have a few minutes and feel like it, we would love to hear how this went for you: https://ls.librecode.coop/index.php/645932?lang=en&source=github-first-merged-pr&repository={repository_name|urlencode}. It is entirely optional; nothing is expected of you in return for contributing. + + Come say hello in the LibreSign community: https://t.me/LibreSign + + steps: + # pull_request_target is intentionally used without checkout. Nothing + # from the pull request head is downloaded or executed. + - name: Comment on first merged pull request + uses: LibreCodeCoop/github-workflows/actions/first-merged-pr-comment@6816f216b2b04d5dd63d01711f88c5ff1d1e0740 + with: + github-token: ${{ github.token }} + pull-request-number: >- + ${{ github.event.pull_request.number || inputs.pull_request_number }} + message-template: ${{ env.FIRST_MERGED_PR_MESSAGE }} From ed1bf92a765e48308b7f824ec5cb44ef9e55b814 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Wed, 23 Sep 2026 17:12:28 -0300 Subject: [PATCH 2/2] fix(ci): read contributor message from repository variable Signed-off-by: Vitor Mattos --- .github/workflows/first-merged-pr-comment.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/first-merged-pr-comment.yml b/.github/workflows/first-merged-pr-comment.yml index bcbb42aaf6..1f966333bb 100644 --- a/.github/workflows/first-merged-pr-comment.yml +++ b/.github/workflows/first-merged-pr-comment.yml @@ -38,18 +38,6 @@ jobs: permissions: pull-requests: write - env: - FIRST_MERGED_PR_MESSAGE: | - Hi {contributor_mention}, your first pull request to LibreSign has been merged. 🎉 - - Your work is part of LibreSign now, and everyone who signs a document with it benefits from the time and knowledge you shared. Thank you. - - You are very welcome to contribute again. The [good first issue]({repository_url}/labels/good%20first%20issue) list is a good place to look next, and you no longer have to wonder how the process works. - - If you have a few minutes and feel like it, we would love to hear how this went for you: https://ls.librecode.coop/index.php/645932?lang=en&source=github-first-merged-pr&repository={repository_name|urlencode}. It is entirely optional; nothing is expected of you in return for contributing. - - Come say hello in the LibreSign community: https://t.me/LibreSign - steps: # pull_request_target is intentionally used without checkout. Nothing # from the pull request head is downloaded or executed. @@ -59,4 +47,4 @@ jobs: github-token: ${{ github.token }} pull-request-number: >- ${{ github.event.pull_request.number || inputs.pull_request_number }} - message-template: ${{ env.FIRST_MERGED_PR_MESSAGE }} + message-template: ${{ vars.FIRST_MERGED_PR_MESSAGE }}