Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/scripts/label_community_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests

GITHUB_API_URL = "https://api.github.com"
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN")
GITHUB_TOKEN = os.environ.get("MY_GITHUB_TOKEN")
assert GITHUB_TOKEN, "GITHUB_TOKEN environment variable not set"

HEADERS = {
Expand Down Expand Up @@ -95,9 +95,9 @@ def main():
is_member = pr_author.lower() in nvidia_members
print(f"User '{pr_author}' is a member of NVIDIA: {is_member}")

if not is_member:
if is_member:
print(
f"User '{pr_author}' is a community user. Adding label '{community_label}'."
f"User '{pr_author}' is not a community user. Adding label '{community_label}'."
)
add_label_to_pr(repo_name, pr_number, community_label)
else:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/label_community_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Label Community PR
on:
pull_request:
types: [opened]
permissions:
pull-requests: write

jobs:
label_pr:
Expand All @@ -21,9 +23,9 @@ jobs:

- name: Run labeling script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO_NAME: ${{ github.event.repository.name }}
COMMUNITY_LABEL: "Community want to contribute"
COMMUNITY_LABEL: "invalid"
run: python .github/scripts/label_community_user.py
Loading