Repository navigation
fix(ci): stop welcoming returning contributors as first-timers - #172
Merged
google-oss-prow[bot] merged 1 commit intoAug 25, 2026
Conversation
actions/first-interaction@v3 posts the 'first PR' welcome on every PR opened by an author who has never filed an issue in the repo: its isFirstPullRequest() check ignores the author entirely, and the skip guard requires both the issue and PR checks to report 'not first', so isFirstIssue() returning true (no issues by the author) bypasses the skip on PR events. See actions/first-interaction#369 upstream. Replace it with an actions/github-script step that searches the author's own history (type:pr / type:issue) and only greets a genuine first issue or first PR. Keeps the same welcome messages, skips bots, and drops the unneeded contents:write permission. Fixes: kubeflow#171 Signed-off-by: Kartikeya Trivedi <kartikeyatrivedi4oct2004@gmail.com>
Member
|
/ok-to-test |
Member
|
Thanks @Kartikeya-trivedi ! |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhijeet-dhumal The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2 tasks
Member
|
/retest-cancel |
Member
|
/retest |
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.
What this PR does
Fixes the
Welcome new contributorsworkflow greeting returning contributors with "Thanks for opening your first PR!" on every PR they open (happened on #90, #147, and #170 — all mine, well after #30 was merged).Root cause
actions/first-interaction@v3is broken (see #171 for the full analysis, and upstream actions/first-interaction#369):isFirstPullRequest()lists all repo PRs with no author filter, so it can only be true for the repo's literal first PR.if (!isFirstIssue && !isFirstPullRequest) skip— on a PR event it still consultsisFirstIssue, which is author-filtered. Any PR author who has never filed an issue in this repo makes that check true, bypassing the skip, so thepr_messageposts on every PR they open.The fix
Replace
actions/first-interactionwith a smallactions/github-scriptstep that:type:pr author:X/type:issue author:X) and only comments when no earlier item by them existsenvso no script injection surface)contents: writepermission (least privilege — the job only comments)The workflow keeps running on
pull_request_targetso it can comment on fork PRs; the script never checks out or executes PR code, so that trigger remains safe.Fixes #171