From b8a648b6e1693330148a6f6bc6cc77aa73435518 Mon Sep 17 00:00:00 2001 From: Ilir Bekteshi Date: Mon, 16 Aug 2021 13:58:18 +0200 Subject: [PATCH] "revert" capture whole run --- action.yml | 5 ++--- entrypoint.sh | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 3173aa8..d1d1514 100644 --- a/action.yml +++ b/action.yml @@ -35,9 +35,8 @@ runs: steps: - id: yamllint run: | - LOGFILE=yamllint.log - ${{ github.action_path }}/entrypoint.sh | tee -a $LOGFILE - echo "::set-output name=logfile::$(realpath ${LOGFILE})" + export LOGFILE=$(mktemp yamllint-XXXXXX) + ${{ github.action_path }}/entrypoint.sh shell: bash env: INPUT_FILE_OR_DIR: ${{ inputs.file_or_dir }} diff --git a/entrypoint.sh b/entrypoint.sh index 7ae3616..22f22f8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,6 +4,10 @@ echo "======================" echo "= Linting YAML files =" echo "======================" +if [[ -z "$LOGFILE" ]]; then + LOGFILE=$(mktemp yamllint-XXXXXX) +fi + if [[ -n "$INPUT_CONFIG_FILE" ]]; then options+=(-c "$INPUT_CONFIG_FILE") fi @@ -28,4 +32,6 @@ shopt -s globstar options+=("${INPUT_FILE_OR_DIR:-.}") shopt -u globstar -yamllint "${options[@]}" +yamllint "${options[@]}" | tee -a "$LOGFILE" + +echo "::set-output name=logfile::$(realpath ${LOGFILE})"