Skip to content

Add GitHub actions to automatically mark community contributions#3007

Open
ptrendx wants to merge 4 commits into
NVIDIA:mainfrom
ptrendx:pr_automatic_community_labelling
Open

Add GitHub actions to automatically mark community contributions#3007
ptrendx wants to merge 4 commits into
NVIDIA:mainfrom
ptrendx:pr_automatic_community_labelling

Conversation

@ptrendx
Copy link
Copy Markdown
Member

@ptrendx ptrendx commented May 18, 2026

Description

GitHub action to automatically mark the external contributions as community-contribution and the NVIDIA contributions from outside the core team as org-contributions.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
@ptrendx ptrendx requested a review from timmoon10 May 18, 2026 21:33
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR adds a GitHub Actions workflow (pull_request_target) that automatically applies community-contribution or org-contribution labels to new and updated PRs based on the author's org membership and repository permission level.

  • Labels are assigned by checking author_association (MEMBER/OWNER → core-team path; everyone else → community) and then calling getCollaboratorPermissionLevel for org members to distinguish core from non-core contributors.
  • The workflow is scoped with minimal permissions (contents: read, issues: write) and the actions/github-script action is pinned to a commit SHA.

Confidence Score: 4/5

The workflow is safe to merge but will mislabel explicitly-invited repository collaborators as community contributors.

The author_association === 'COLLABORATOR' case is missing from the org-member guard. Any user explicitly invited to the repo with push access will be routed to the community-contribution branch instead of having their permission level checked — the opposite of the intended behavior. Everything else (pinned action SHA, minimal permissions, try/catch around the API call) is correctly implemented.

.github/workflows/community_label.yml — specifically the isOrgMember condition at lines 32–33.

Important Files Changed

Filename Overview
.github/workflows/community_label.yml New workflow that auto-labels PRs as community-contribution or org-contribution; the COLLABORATOR author_association is omitted from the org-member check, causing explicitly-invited collaborators to be mislabeled as community contributors.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[PR opened / synchronized] --> B{author_association}
    B -- MEMBER or OWNER --> C[getCollaboratorPermissionLevel]
    B -- COLLABORATOR
⚠️ incorrectly routed --> D[Label: community-contribution]
    B -- CONTRIBUTOR / NONE / etc. --> D
    C -- write or admin --> E[No label applied]
    C -- read / triage / none --> F[Label: org-contribution]
    C -- 404 error --> G[maintain / other → org-contribution]
    D --> H[addLabels API call]
    F --> H
Loading

Reviews (3): Last reviewed commit: "Remove unnecessary indentation" | Re-trigger Greptile

Comment thread .github/workflows/community_label.yml Outdated
Comment thread .github/workflows/community_label.yml Outdated
Comment thread .github/workflows/community_label.yml Outdated
Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
Comment thread .github/workflows/community_label.yml Outdated
ptrendx added 2 commits May 18, 2026 16:30
Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
Comment thread .github/workflows/community_label.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant