feat: label issues from non-org-members across all repos - #104
Open
John McCall (lowlydba) wants to merge 5 commits into
Open
John McCall (lowlydba) wants to merge 5 commits into
John McCall (lowlydba) wants to merge 5 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: John McCall <john@overturemaps.org>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: John McCall <john@overturemaps.org>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: John McCall <john@overturemaps.org>
Eric Godwin (ericgodwin)
previously approved these changes
Sep 16, 2026
There was a problem hiding this comment.
🟡 Changes recommended
The workflow path, membership handling, and input validation require fixes before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a scheduled workflow and reusable action to label issues opened by non-organization members across repositories.
Changes:
- Adds scheduled/manual workflow with GitHub App authentication.
- Implements issue search, membership checks, bot skipping, labeling, and dry-run support.
- Adds action validation and setup documentation.
File summaries
| File | Summary |
|---|---|
.github/workflows/label-external-issues.yml |
Runs the cross-repository labeling job; the local action path must be corrected from $/. to ./. |
.github/actions/label-external-issues/src/index.js |
Discovers issues and applies labels; pending invitations must be handled as non-members. |
.github/actions/label-external-issues/README.md |
Documents action usage and setup. |
.github/actions/label-external-issues/action.yml |
Defines inputs and execution; numeric validation must reject malformed values such as 180minutes. |
Review details
Suppressed comments (1)
.github/actions/label-external-issues/src/index.js:63
- The membership endpoint distinguishes an active member (204) from a pending invitation (302), but this code treats every successful response as membership and only maps 404 to non-member. A newly invited author is therefore either skipped as a member or causes the run to fail depending on redirect handling, instead of being classified consistently; handle 302 as non-member and only accept 204.
await github.rest.orgs.checkMembershipForUser({ org, username });
return true;
} catch (error) {
if (error.status === 404) {
return false;
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+79
to
+80
| const lookbackMinutes = parseInt(process.env.LOOKBACK_MINUTES, 10); | ||
| if (!Number.isInteger(lookbackMinutes) || lookbackMinutes <= 0) { |
Fixes three review comments: the local action reference used `$/.` instead of `./`, which would fail the workflow before labeling ran; lookbackMinutes used a bare parseInt so "180minutes" passed validation; and checkMembership only treated 404 as non-member, so a 302 (pending invitation) would have been misread as a member. Also has the action create the target label itself the first time it needs to apply it, instead of requiring a manual setup step per repo. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: John McCall <john@overturemaps.org>
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.
Adds a scheduled
label-external-issuesaction and workflow that labels org-wide issues opened by non-org-members, reusing theoverture-project-managerApp and OIDC/Secrets Manager plumbing fromsync-project-status.ymlinstead of standing up a new App.Each run searches for open, unlabeled issues created since the last window, skips bot authors, checks org membership per author, and adds the
externallabel to non-members.overture-project-managernow has Organization: Members (read) and Repository: Issues (write) added to its permission set, so this is ready to run once merged.Testing
Ran
zizmor --persona pedanticagainst both new files, no findings. Verified the action module loads withnode -eand that the workflow/action YAML parse.workflow_dispatchonly works via API/CLI once the workflow file exists on the default branch, so I couldn't dry-run this from the PR branch. Worth a manualdry_rundispatch right after merge to confirm the App permissions and search query behave as expected before relying on it.Fixes #103