Replace broken actions/first-interaction with an inline github-script - #398
Open
tpvasconcelos wants to merge 2 commits into
Open
Replace broken actions/first-interaction with an inline github-script#398tpvasconcelos wants to merge 2 commits into
actions/first-interaction with an inline github-script#398tpvasconcelos wants to merge 2 commits into
Conversation
The v3 rewrite of actions/first-interaction dropped the per-author filter from its first-PR check and ORs the issue/PR checks together, so the "first pull request" greeting fires for every PR whose author has never opened an issue in this repo - i.e. on every single PR from pre-commit.ci, dependabot, and Copilot. Broken upstream since v3.1.0 with no fix available (actions/first-interaction#369). Replace it with an inline actions/github-script step that restores the correct v1 semantics, never greets bots, runs with a least-privilege token, and fails soft on API errors.
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #398 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 19
Lines 674 674
Branches 88 88
=========================================
Hits 674 674
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
actions/first-interaction@v3posts the "first pull request" greeting on every PR from any author who has never opened an issue in this repo — which in practice means every PR from pre-commit.ci, dependabot, and Copilot (#350, #355, #358, #362, #366, #374, #379, #380–#383, #395, ...). The v3 rewrite introduced two regressions: it ORs the first-issue/first-PR checks together instead of branching on the event type, and its first-PR check lost the per-author filter entirely. The bug also affects humans: any contributor who never filed an issue here would be re-greeted on every new PR. Upstream has been broken since Oct 2025 with no fix in sight.This PR replaces the action with an inline
actions/github-script@v9step (already a dependency of other workflows here) that restores the correct v1 semantics and hardens the workflow:user.type == "Bot": pre-commit.ci, dependabot, github-actions, Copilot, ...)OWNER/MEMBER/COLLABORATORauthors cheaply (shortcut only — a missing/unreliableauthor_associationfalls through to the real check, so it can never cause a wrong greeting)permissions:block (issues: write+pull-requests: write) instead of the repo-default write-all tokenpull_request_targetwith no checkout and no${{ }}-interpolation of untrusted fields into the script sourceValidation performed:
check-yaml, GitHub workflow schema validation,actionlint, and thetimeout-minuteshook)actions/github-scriptdoes) against mockedcore/context/githubobjects replaying real scenarios: pre-commit-ci's [pre-commit.ci] pre-commit autoupdate #395, owner PRs, a repeat external contributor, a genuine first PR/issue, a second issue from the same reporter, a first issue from a previous PR author, and an API failure — 8/8 passNote:
issuesandpull_request_targetworkflows run the default-branch version, so this only takes effect after merging. The next pre-commit.ci autoupdate is the natural negative test; the next external contributor is the positive one.Related issues
Upstream: actions/first-interaction#369 (broken first-contribution detection), actions/first-interaction#394 (request to ignore bots). Latest upstream release is still v3.1.0 (Oct 2025); both issues remain open.
PR check list
docs/reference/changelog.md. (Entry added in a follow-up commit referencing this PR's number.)📚 Documentation preview 📚: https://ridgeplot--398.org.readthedocs.build/en/398/