What happened
The same returning contributor received "Thanks for your first pull request" on every PR from #210 through #214. This is duplicate comment posting, not just the workflow appearing in the Actions list.
Examples:
Cause and starting point
.github/workflows/greet.yml invokes actions/first-interaction@v3. Its upstream src/main.ts combines first-issue and first-PR checks with OR semantics. A person with no earlier issues can therefore pass the first-issue check on every PR. Its PR check also lists repository PRs without filtering by author.
Source: https://github.com/actions/first-interaction/blob/v3/src/main.ts
A workflow run on every opened event is expected. The bug is posting a welcome comment when this author already opened an earlier item of the same type.
Proposed approach
Replace the upstream first-interaction decision with a small repository-controlled check, for example using a pinned actions/github-script step. Use the opened item's author, query repository history with pagination and state: all, and distinguish issues from PRs. The issues-list API can return both, so filter using the pull_request field.
Policy for this task: greet once on an author's first PR and once on their first issue in this repository. An earlier item counts whether open, closed, or merged. Compare item numbers to the current item so later submissions do not prevent the earliest one from being greeted.
Acceptance criteria
This is a small GitHub Actions/JavaScript task with a defined policy. Keep it focused on greeting eligibility and duplicate prevention; do not add persistent storage, change contribution requirements, or remove historical comments.
See CONTRIBUTING.md; use British English and sign off commits with git commit -s.
What happened
The same returning contributor received "Thanks for your first pull request" on every PR from #210 through #214. This is duplicate comment posting, not just the workflow appearing in the Actions list.
Examples:
Cause and starting point
.github/workflows/greet.ymlinvokesactions/first-interaction@v3. Its upstreamsrc/main.tscombines first-issue and first-PR checks with OR semantics. A person with no earlier issues can therefore pass the first-issue check on every PR. Its PR check also lists repository PRs without filtering by author.Source: https://github.com/actions/first-interaction/blob/v3/src/main.ts
A workflow run on every opened event is expected. The bug is posting a welcome comment when this author already opened an earlier item of the same type.
Proposed approach
Replace the upstream first-interaction decision with a small repository-controlled check, for example using a pinned
actions/github-scriptstep. Use the opened item's author, query repository history with pagination andstate: all, and distinguish issues from PRs. The issues-list API can return both, so filter using thepull_requestfield.Policy for this task: greet once on an author's first PR and once on their first issue in this repository. An earlier item counts whether open, closed, or merged. Compare item numbers to the current item so later submissions do not prevent the earliest one from being greeted.
Acceptance criteria
pull_request_target, never check out or execute contributor-controlled code; pass event values as data, not interpolated executable script text.This is a small GitHub Actions/JavaScript task with a defined policy. Keep it focused on greeting eligibility and duplicate prevention; do not add persistent storage, change contribution requirements, or remove historical comments.
See
CONTRIBUTING.md; use British English and sign off commits withgit commit -s.