diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml index f57248c7dd..4b181a1127 100644 --- a/.github/workflows/pr-code-format.yml +++ b/.github/workflows/pr-code-format.yml @@ -69,10 +69,10 @@ jobs: # explicitly in code-format-helper.py and not have to diff starting at # the merge base. run: | - echo "[]" > comments && + echo "[]" > $PWD/comments && python ./External/code-format-helper/code-format-helper.py \ --repo "FEX-emu/FEX" \ - --write-comment-to-file \ + --write-comment-to-file $PWD/comments \ --issue-number $GITHUB_PR_NUMBER \ --start-rev $(git merge-base $START_REV $END_REV) \ --end-rev $END_REV \ diff --git a/External/code-format-helper/code-format-helper.py b/External/code-format-helper/code-format-helper.py index 5b47206d93..176839849d 100644 --- a/External/code-format-helper/code-format-helper.py +++ b/External/code-format-helper/code-format-helper.py @@ -44,7 +44,7 @@ class FormatArgs: token: str = None verbose: bool = True issue_number: int = 0 - write_comment_to_file: bool = False + write_comment_to_file: str = None def __init__(self, args: argparse.Namespace = None) -> None: if not args is None: @@ -58,7 +58,7 @@ def __init__(self, args: argparse.Namespace = None) -> None: class FormatHelper: - COMMENT_TAG = "" + COMMENT_TAG = "" name: str friendly_name: str comment: dict = None @@ -365,8 +365,8 @@ def hook_main(): ) parser.add_argument( "--write-comment-to-file", - action="store_true", - help="Don't post comments on the PR, instead write the comments and metadata a file called 'comment'", + type=str, + help="Don't post comments on the PR, instead write the comments and metadata a file", ) args = FormatArgs(parser.parse_args()) @@ -384,7 +384,7 @@ def hook_main(): comments.append(fmt.comment) if len(comments): - with open("comments", "w") as f: + with open(args.write_comment_to_file, "w") as f: import json json.dump(comments, f)