All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
64887aa)
* send output to $GITHUB_STEP_SUMMARY
* update CHANGES.md
* update CHANGES.md with PR number
* implement PR feedback
* fix pre-commit issues (prettier/trailing whitespace)
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
+- Update GitHub Action to display black output in the job summary (#3688)
+
### Documentation
<!-- Major changes to documentation and policies. Small docs changes
### Documentation
<!-- Major changes to documentation and policies. Small docs changes
runs:
using: composite
steps:
runs:
using: composite
steps:
if [ "$RUNNER_OS" == "Windows" ]; then
if [ "$RUNNER_OS" == "Windows" ]; then
- python $GITHUB_ACTION_PATH/action/main.py
+ python $GITHUB_ACTION_PATH/action/main.py | tee -a $GITHUB_STEP_SUMMARY
- python3 $GITHUB_ACTION_PATH/action/main.py
+ python3 $GITHUB_ACTION_PATH/action/main.py | tee -a $GITHUB_STEP_SUMMARY
fi
env:
# TODO: Remove once https://github.com/actions/runner/issues/665 is fixed.
fi
env:
# TODO: Remove once https://github.com/actions/runner/issues/665 is fixed.
describe_name = line[len("describe-name: ") :].rstrip()
break
if not describe_name:
describe_name = line[len("describe-name: ") :].rstrip()
break
if not describe_name:
- print("::error::Failed to detect action version.", flush=True)
+ print("::error::Failed to detect action version.", file=sys.stderr, flush=True)
sys.exit(1)
# expected format is one of:
# - 23.1.0
sys.exit(1)
# expected format is one of:
# - 23.1.0
)
if pip_proc.returncode:
print(pip_proc.stdout)
)
if pip_proc.returncode:
print(pip_proc.stdout)
- print("::error::Failed to install Black.", flush=True)
+ print("::error::Failed to install Black.", file=sys.stderr, flush=True)
sys.exit(pip_proc.returncode)
base_cmd = [str(ENV_BIN / "black")]
if BLACK_ARGS:
# TODO: remove after a while since this is deprecated in favour of SRC + OPTIONS.
sys.exit(pip_proc.returncode)
base_cmd = [str(ENV_BIN / "black")]
if BLACK_ARGS:
# TODO: remove after a while since this is deprecated in favour of SRC + OPTIONS.
- proc = run([*base_cmd, *shlex.split(BLACK_ARGS)])
+ proc = run(
+ [*base_cmd, *shlex.split(BLACK_ARGS)],
+ stdout=PIPE,
+ stderr=STDOUT,
+ encoding="utf-8",
+ )
- proc = run([*base_cmd, *shlex.split(OPTIONS), *shlex.split(SRC)])
-
+ proc = run(
+ [*base_cmd, *shlex.split(OPTIONS), *shlex.split(SRC)],
+ stdout=PIPE,
+ stderr=STDOUT,
+ encoding="utf-8",
+ )
+print(proc.stdout)
sys.exit(proc.returncode)
sys.exit(proc.returncode)