Skip to content

Commit

Permalink
Merge pull request #18 from dfinity/change-env-var-name
Browse files Browse the repository at this point in the history
Change env var name
  • Loading branch information
cgundy authored Oct 13, 2023
2 parents 518486b + e6ef3fb commit ddeb188
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check_cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion reusable_workflows/check_membership/check_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions reusable_workflows/tests/test_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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):
Expand Down

0 comments on commit ddeb188

Please sign in to comment.