Skip to content

Fix Welcome New Contributors workflow: replace broken first-interaction action#234

Merged
swissspidy merged 5 commits intomainfrom
copilot/fix-welcome-new-contributors-workflow
Apr 10, 2026
Merged

Fix Welcome New Contributors workflow: replace broken first-interaction action#234
swissspidy merged 5 commits intomainfrom
copilot/fix-welcome-new-contributors-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

actions/first-interaction has a known bug that causes it to always post the welcome comment, regardless of whether the author is a returning contributor.

Changes

  • Removes actions/first-interaction entirely
  • Adds a Check if first PR step using actions/github-script that queries the GitHub Search API for the author's prior PRs in the repo — returns true only when total_count <= 1
  • Adds a Welcome New Contributor step that posts the comment only when the author is not a bot and the first-PR check passes
- name: Check if first PR
  id: first-pr-check
  if: steps.bot-author-check.outputs.result != 'true'
  uses: actions/github-script@... # v8
  with:
    result-encoding: string
    script: |
      const { data } = await github.rest.search.issuesAndPullRequests({
        q: `is:pr repo:${context.repo.owner}/${context.repo.repo} author:${context.payload.sender.login}`,
        per_page: 2,
      });
      return String(data.total_count <= 1);

- name: Welcome New Contributor
  if: steps.bot-author-check.outputs.result != 'true' && steps.first-pr-check.outputs.result == 'true'
  ...

The per_page: 2 cap keeps the search query cheap; total_count <= 1 handles the case where the search index hasn't yet indexed the current PR.

Copilot AI linked an issue Apr 9, 2026 that may be closed by this pull request
@github-actions github-actions bot added the enhancement New feature or request label Apr 9, 2026
Copilot AI changed the title [WIP] Fix newcomer check in Welcome New Contributors workflow Fix Welcome New Contributors workflow: replace broken first-interaction action Apr 9, 2026
Copilot AI requested a review from swissspidy April 9, 2026 08:52
@swissspidy swissspidy requested a review from Copilot April 10, 2026 08:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the reusable “Welcome New Contributors” GitHub Actions workflow to avoid the actions/first-interaction bug that posts welcome comments for returning contributors, by replacing it with an explicit first-PR check and a conditional comment step.

Changes:

  • Remove actions/first-interaction usage.
  • Add a GitHub Search API check (via actions/github-script) to determine whether the PR author has prior PRs in the repo.
  • Post the welcome comment only when the author is not a bot and the first-PR check passes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

swissspidy and others added 2 commits April 10, 2026 11:53
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@swissspidy swissspidy marked this pull request as ready for review April 10, 2026 12:31
@swissspidy swissspidy requested a review from a team as a code owner April 10, 2026 12:31
@swissspidy swissspidy merged commit c017cb8 into main Apr 10, 2026
11 checks passed
@swissspidy swissspidy deleted the copilot/fix-welcome-new-contributors-workflow branch April 10, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request scope:meta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Welcome New Contributors workflow

3 participants