diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f96e875..0c81eba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,16 +14,4 @@ jobs: - run: echo $GITHUB_RUN_ID - run: echo $GITHUB_EVENT_PATH - run: echo $GITHUB_REF - - run: echo $GITHUB_ENV - - run: echo "HELLO=WORLD" >> $GITHUB_ENV - - run: | - echo 'JSON_RESPONSE<> $GITHUB_ENV - curl https://httpbin.org/json >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - run: cat $GITHUB_ENV - - run: echo $GITHUB_PATH - - run: echo "/path/to/some/dir" >> $GITHUB_PATH - - run: cat $GITHUB_PATH - run: python check_run.py - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/check_pr_files.py b/check_pr_files.py index b937338..83ab661 100644 --- a/check_pr_files.py +++ b/check_pr_files.py @@ -1,11 +1,11 @@ -def test1(a): +def test1(abc) -> bool: """ A test function """ return False -def test3(e: int) -> None: +def test3(emhb) -> None: """ >>> test3(1, 1, 1) """ @@ -13,12 +13,14 @@ def test3(e: int) -> None: class TClass: - def __init__(self, test: str) -> None: + def __init__(self, test: str): self.test = test - def add(self, a: int, b: int) -> int: + def add(self, a: int, bdfgsd: int) -> int: """ Add two numbers + >>> add(1, 1) + 2 """ return a + b diff --git a/check_run.py b/check_run.py index 56d62b9..4d8c916 100644 --- a/check_run.py +++ b/check_run.py @@ -1,9 +1,19 @@ import sys import os import json +from pprint import pprint -print(os.getenv("GITHUB_REF")) -print("Pull request:", os.getenv("GITHUB_REF").split("/")[2]) -print(os.getenv("GITHUB_EVENT_PATH")) +print(os.getenv("GITHUB_API_URL")) +print(os.getenv("GITHUB_EVENT_NAME")) +event_path = os.getenv("GITHUB_EVENT_PATH") +print("Event path:", event_path) + +with open(event_path) as f: + event = json.load(f) + +print(event["pull_request"]["url"] + "/files") +pprint(event["number"]) +print(os.getcwd()) + sys.exit(0)