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..1f966333bb --- /dev/null +++ b/.github/workflows/first-merged-pr-comment.yml @@ -0,0 +1,50 @@ +# 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 + + 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: ${{ vars.FIRST_MERGED_PR_MESSAGE }}