From 474c2e472e8cd87917f9040257292bf02a2c690e Mon Sep 17 00:00:00 2001 From: Carly Gundy <47304080+cgundy@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:01:33 +0200 Subject: [PATCH 1/3] Update check_cla.yml --- .github/workflows/check_cla.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_cla.yml b/.github/workflows/check_cla.yml index c5e13f9..285a645 100644 --- a/.github/workflows/check_cla.yml +++ b/.github/workflows/check_cla.yml @@ -43,7 +43,7 @@ jobs: run: python reusable_workflows/check_membership/check_membership.py shell: bash env: - GITHUB_TOKEN: ${{ secrets.CLA_READ_ORG_MEMBERSHIP }} + GH_TOKEN: ${{ secrets.CLA_READ_ORG_MEMBERSHIP }} GH_ORG: ${{ github.repository_owner }} USER: ${{ github.event.pull_request.user.login }} @@ -73,7 +73,7 @@ jobs: python reusable_workflows/check_membership/check_external_contrib.py shell: bash env: - GITHUB_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ github.token }} REPO: ${{ github.event.repository.name }} - name: Checkout @@ -90,7 +90,7 @@ jobs: — The DFINITY Foundation" gh pr close ${{ github.event.number }} --comment "$message" env: - GITHUB_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ github.token }} - name: Add Label uses: actions-ecosystem/action-add-labels@v1 From 2ea3f77c2b4224c1613d5cfb721ee9616c0f78ac Mon Sep 17 00:00:00 2001 From: Carly Gundy <47304080+cgundy@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:02:41 +0200 Subject: [PATCH 2/3] Update check_membership.py --- reusable_workflows/check_membership/check_membership.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reusable_workflows/check_membership/check_membership.py b/reusable_workflows/check_membership/check_membership.py index 52381b8..d05090c 100644 --- a/reusable_workflows/check_membership/check_membership.py +++ b/reusable_workflows/check_membership/check_membership.py @@ -12,7 +12,7 @@ def is_member_of_org(gh: github3.login, org: str, user: str) -> bool: def main() -> None: org = os.environ["GH_ORG"] - gh_token = os.environ["GITHUB_TOKEN"] + gh_token = os.environ["GH_TOKEN"] user = os.environ["USER"] gh = github3.login(token=gh_token) From e6ef3fb140f2664cac6aebe3837665621f85df1b Mon Sep 17 00:00:00 2001 From: Carly Gundy <47304080+cgundy@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:03:28 +0200 Subject: [PATCH 3/3] Update test_membership.py --- reusable_workflows/tests/test_membership.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reusable_workflows/tests/test_membership.py b/reusable_workflows/tests/test_membership.py index e6d68c4..1345132 100644 --- a/reusable_workflows/tests/test_membership.py +++ b/reusable_workflows/tests/test_membership.py @@ -30,7 +30,7 @@ def test_not_member(): @mock.patch.dict( - os.environ, {"GH_ORG": "my_org", "GITHUB_TOKEN": "secret", "USER": "username"} + os.environ, {"GH_ORG": "my_org", "GH_TOKEN": "secret", "USER": "username"} ) @mock.patch("github3.login") @mock.patch("os.system") @@ -52,7 +52,7 @@ def test_end_to_end_is_member(os_system, github_login_mock, capfd): @mock.patch.dict( - os.environ, {"GH_ORG": "my_org", "GITHUB_TOKEN": "secret", "USER": "username"} + os.environ, {"GH_ORG": "my_org", "GH_TOKEN": "secret", "USER": "username"} ) @mock.patch("github3.login") @mock.patch("os.system") @@ -74,7 +74,7 @@ def test_end_to_end_is_not_member(os_system, github_login_mock, capfd): @mock.patch.dict( - os.environ, {"GH_ORG": "my_org", "GITHUB_TOKEN": "secret", "USER": "username"} + os.environ, {"GH_ORG": "my_org", "GH_TOKEN": "secret", "USER": "username"} ) @mock.patch("github3.login") @mock.patch("os.system") @@ -91,7 +91,7 @@ def test_end_to_end_api_fails(os_system, github_login_mock): @mock.patch.dict( - os.environ, {"GH_ORG": "my_org", "GITHUB_TOKEN": "", "USER": "username"} + os.environ, {"GH_ORG": "my_org", "GH_TOKEN": "", "USER": "username"} ) @mock.patch("github3.login") def test_github_token_not_passed_in(github_login_mock):