|
| 1 | +<!-- |
| 2 | +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors |
| 3 | +SPDX-License-Identifier: AGPL-3.0-or-later |
| 4 | +--> |
| 5 | + |
| 6 | +# First merged contribution workflow |
| 7 | + |
| 8 | +The `first-merged-contribution` workflow template thanks a contributor after the |
| 9 | +first pull request they actually get merged in a repository. |
| 10 | + |
| 11 | +It is designed for `pull_request_target` and intentionally does not check out, |
| 12 | +download, or execute pull-request content. The workflow only reads event |
| 13 | +metadata, checks the contributor's merged pull-request history, and creates a |
| 14 | +comment on the merged pull request. |
| 15 | + |
| 16 | +## Repository variables |
| 17 | + |
| 18 | +All variables are optional: |
| 19 | + |
| 20 | +- `FIRST_MERGED_CONTRIBUTION_MESSAGE`: complete custom message template. |
| 21 | + Supported placeholders are `{user}`, `{repository}`, `{pull_request}`, |
| 22 | + `{survey_url}`, and `{community_url}`. |
| 23 | +- `CONTRIBUTOR_SURVEY_URL`: survey base URL. The workflow appends |
| 24 | + `source=github-first-merged-pr` and the repository name. |
| 25 | +- `COMMUNITY_URL`: optional community link. |
| 26 | + |
| 27 | +When `FIRST_MERGED_CONTRIBUTION_MESSAGE` is unset, the workflow uses a short |
| 28 | +generic thank-you message and appends the optional survey and community links. |
| 29 | + |
| 30 | +## Permissions and security |
| 31 | + |
| 32 | +The workflow starts with `permissions: {}` and grants only: |
| 33 | + |
| 34 | +- `contents: read`; |
| 35 | +- `pull-requests: write`. |
| 36 | + |
| 37 | +The write permission is required only to create the pull-request comment. |
| 38 | + |
| 39 | +The implementation uses the GitHub-maintained `actions/github-script` action |
| 40 | +pinned to an immutable commit. It does not use a Docker action or build a |
| 41 | +container image, so it does not inherit the obsolete Debian/Node container used |
| 42 | +by the previous third-party first-interaction action. |
| 43 | + |
| 44 | +Because the workflow runs as `pull_request_target`, never add checkout or any |
| 45 | +execution of code, scripts, artifacts, or configuration from the pull request |
| 46 | +head to this workflow. |
0 commit comments