From c541b5c45608a19f2c21d13f8b563eca002a4657 Mon Sep 17 00:00:00 2001 From: Gaurav Nelson Date: Tue, 9 Aug 2022 18:16:23 +1000 Subject: [PATCH] Added results as output parameters --- .github/workflows/push.yml | 5 +++++ entrypoint.sh | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 450e78f..29579c2 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,6 +9,11 @@ jobs: uses: ./ with: check-modified-files-only: 'yes' + id: markdown-link-check + - name: display errors + run: | + echo "${{ steps.markdown-link-check.outputs.MLC_OUTPUT }}" + markdown-link-check-folders: runs-on: ubuntu-latest steps: diff --git a/entrypoint.sh b/entrypoint.sh index ce08240..4ef3fae 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,6 +24,7 @@ FOLDER_PATH="$4" MAX_DEPTH="$5" CHECK_MODIFIED_FILES="$6" BASE_BRANCH="$7" + if [ -z "$8" ]; then FILE_EXTENSION=".md" else @@ -94,6 +95,9 @@ check_errors () { cat error.txt printf "\n" echo -e "${YELLOW}=========================================================================${NC}" + echo "MLC_OUTPUT<> "$GITHUB_ENV" + cat error.txt >> "$GITHUB_ENV" + echo "EOF" >> "$GITHUB_ENV" exit 113 else echo -e "${YELLOW}=========================> MARKDOWN LINK CHECK <=========================${NC}" @@ -101,9 +105,11 @@ check_errors () { echo -e "${GREEN}[✔] All links are good!${NC}" printf "\n" echo -e "${YELLOW}=========================================================================${NC}" + echo "MLC_OUTPUT=[✔] All links are good!" >> "$GITHUB_OUTPUT" fi else echo -e "${GREEN}All good!${NC}" + echo "MLC_OUTPUT=All good!" >> "$GITHUB_OUTPUT" fi }