Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
feat: Test set-output
Browse files Browse the repository at this point in the history
  • Loading branch information
EnriqueSoria committed Nov 28, 2022
1 parent a99f7e9 commit fa047fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ runs:
steps:
- run: |
output=$(python ${{ github.action_path }}/annotate_pr_with_ruff/main.py)
echo $output
output="${output//'%'/'%25'}"
output="${output//$'\n'/'%0A'}"
output="${output//$'\r'/'%0D'}"
Expand Down
11 changes: 4 additions & 7 deletions annotate_pr_with_ruff/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/python
import json
import os
import sys

print(f"{os.environ['GITHUB_EVENT_PATH']=}")

from changeutils import get_changed_files
from github_utils import get_diff, submit_review
from github_utils import get_diff
from ruff_utils import ruff

print("imports finished")

def main():
with open(os.environ["GITHUB_EVENT_PATH"]) as f:
Expand Down Expand Up @@ -37,10 +38,6 @@ def main():
f"::error file={ruff_error.file},line={ruff_error.line_number}::{ruff_error.message}"
)

if ruff_errors:
ERROR_CODE = 1
sys.exit(ERROR_CODE)


if __name__ == "__main__":
main()

0 comments on commit fa047fe

Please sign in to comment.