feat(ci): thank a contributor after their first merged pull request - #8311
Open
dchaudhari7177 wants to merge 2 commits into
Open
feat(ci): thank a contributor after their first merged pull request#8311dchaudhari7177 wants to merge 2 commits into
dchaudhari7177 wants to merge 2 commits into
Conversation
Adds .github/workflows/contributor-feedback.yml. It fires on pull_request_target: closed, runs only when the pull request was merged and the author is not a bot, and posts one comment through zephyrproject-rtos/action-first-interaction, pinned to a full commit SHA. Only pr-merged-message is configured. The action's own first-merged detection is what makes the message land on the right pull request: a contributor whose earlier attempt was closed unmerged has not had a first successful contribution yet, and greeting the closed one as a success reads wrong. The survey and community links come from the CONTRIBUTOR_SURVEY_URL and COMMUNITY_URL configuration variables, and each sentence is omitted entirely when its variable is unset -- so the workflow can merge before LibreCode has the LimeSurvey URL, and starts including it the moment the variable is added, with no second pull request. Nothing from the pull request is checked out, downloaded or run. permissions is empty at the top level; the job takes contents: read, pull-requests: read and issues: write, the last because a comment on a pull request is posted through the issues API. CONTRIBUTING.md gains a short section saying the note exists and that the survey is optional, so the message is not a surprise. Signed-off-by: dchaudhari7177 <111210939+dchaudhari7177@users.noreply.github.com>
|
Thanks for opening your first pull request in this repository! ✌️ |
YvesCesar
self-requested a review
September 9, 2026 13:33
Contributor
|
I'll review this |
YvesCesar
reviewed
Sep 9, 2026
YvesCesar
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution! :)
I raised a few points for discussion.
vitormattos
requested changes
Sep 11, 2026
vitormattos
left a comment
Member
There was a problem hiding this comment.
Look the previous comments, only changing the status to "request changes".
…IBUTING The survey link went in bare. LibreSign#8292 asks for source=github-first-merged-pr and a repository value read from the event, so both are appended now. Built in a job-level env var rather than inside the message: a LimeSurvey URL often already carries a query string (/index.php?r=survey/index&sid=...), so the separator has to be & in that case, and that logic is unreadable inside a format() in the middle of prose. CONTRIBUTING.md gained the paragraph but not the link LibreSign#8292's checklist asks for. Added as a Contributor feedback section with source=contributing-guide, which is the half that reaches people whose work was never merged -- the post-merge note cannot. Markdown cannot read the repository variable, so the base URL is a reference definition with a .invalid placeholder to substitute once the survey exists. Signed-off-by: dchaudhari7177 <111210939+dchaudhari7177@users.noreply.github.com>
YvesCesar
approved these changes
Sep 12, 2026
|
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Member
|
Thanks a lot @dchaudhari7177 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #8292
📝 Summary
One workflow,
.github/workflows/contributor-feedback.yml, plus a short section inCONTRIBUTING.md. No custom JavaScript and no custom first-contribution detection — the Action already does that part, and doing it by hand is what the issue asks not to do.It fires on
pull_request_target: closed, and the job runs only when:zephyrproject-rtos/action-first-interactionis pinned to58853996b1ac504b8e0f6964301f369d2bb22e5c(v1.1.1+zephyr.6), which I checked is still the newest tag on that Action —v1.1.1+zephyr.6is ahead ofv1.1.1-zephyr-5and ofv1.1.1, andmainhas not moved since 2022. Same SHA Zephyr runs today.Only
pr-merged-messageis set, so nothing is posted when a pull request is merely opened or closed unmerged.Why the Action's detection matters
This is the part that would go wrong in a hand-rolled version. A contributor may have had an earlier pull request closed without being accepted:
The Action searches the author's previous pull requests and treats the first merged one as the milestone, so the greeting lands on the first real contribution rather than on the first attempt.
Configuration variables, and merging before the survey exists
Both URLs come from configuration variables, never hardcoded:
Since the issue says the survey URL is still to be created by LibreCode, each sentence is omitted entirely when its variable is unset:
${{ vars.CONTRIBUTOR_SURVEY_URL && format('… {0} …', vars.CONTRIBUTOR_SURVEY_URL) || '' }}So this can merge now and post a perfectly good message with no survey line at all; the day the variable is set, the line appears with no second pull request. The alternative — a hardcoded placeholder — would either block the merge on the survey or ship a dead link.
Security
permissions: {}at the top level; the job takescontents: read,pull-requests: read,issues: write, and nothing else.issues: writeis required because a comment on a pull request is created through the issues API.actions/checkout, no artifact download, nothing from the head repository is read or executed. The job only reads event metadata and posts a comment, which is the safe shape forpull_request_target..github/workflows/.concurrencygroup keyed on the pull request number, withcancel-in-progress: false, so a rapid reopen/close cannot produce two comments.The message
Congratulates them on a first accepted contribution, thanks them for their time and knowledge, makes it explicit they are welcome again and points at the
good first issuelist, and — only if the variables are set — links the survey and the community. The survey sentence says in as many words that it is optional and that nothing is expected in return, which is the tone the issue asks for.🧪 How to test
The workflow cannot run from a fork's pull request, so on this PR it is inert by design. To exercise it on a branch in the main repository:
CONTRIBUTOR_SURVEY_URLandCOMMUNITY_URLunder Settings → Secrets and variables → Actions → Variables (or leave them unset to see the trimmed message).Locally I validated the file parses and that the
on, top-levelpermissionsand jobpermissionsblocks are exactly as above; I could not runactionlinton this machine.⚙️ API / Back‑end changes
Not applicable — one workflow and a docs section.
✅ Checklist
CONTRIBUTING.mddocuments the note and that the survey is optional.🤖 AI (if applicable)