ci: query collaborator API to skip maintainers in welcome workflow#1970
Merged
brendancol merged 1 commit intoMay 15, 2026
Merged
Conversation
The previous gate skipped maintainers via github.event.pull_request.author_association. On PR xarray-contrib#1968 that field came through as something other than MEMBER for a maintainer's cross-fork PR (brendancol, admin permission), so the welcome workflow greeted them as a first-time contributor. The same field has misreported same-repo maintainer PRs in the past; copilot-review.yml already gates around it via head.repo == base.repo. Apply the equivalent here and add a runtime collaborator-permission lookup so cross-fork PRs from maintainers' personal forks are also skipped. The default GITHUB_TOKEN has read access to the collaborator-permission endpoint on the repo where the workflow runs, so the call works without additional secrets.
|
Hi @brendancol, thanks for the PR! Would you mind filing a quick New contributor introduction issue when you get a chance? It helps us point you at issues that fit what you'd like to work on. Most fields are optional. Reviewing your PR doesn't depend on it, just a friendly nudge. |
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.
Summary
github.event.pull_request.author_associationto skip maintainers inwelcome-contributor.yml. On PR geotiff: fix CI regression where int-coord no-georef writes hit fail-closed guard #1968 the field came through as something other thanMEMBERfor a maintainer's cross-fork PR (admin permission on the repo), so the welcome workflow greeted them as a first-time contributor.head.repo == base.repocheck (same approachcopilot-review.ymluses around the same quirk).gh api repos/$REPO/collaborators/$USER/permission. Anyone withadmin,maintain, orwriteis treated as a maintainer and skipped before the comment posts.The default
GITHUB_TOKENhas read access to the collaborator-permission endpoint on the repo where the workflow runs, so the call works without extra secrets. Addedcontents: readto the permissions block to make that explicit.Test plan
Author is a maintainer; skipping welcome comment.and posts nothing.if:gate (no run logs, conclusionskipped).