diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5661365..bd411a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -194,3 +194,21 @@ jobs: uses: ./ with: token: ${{ secrets.CUSTOM_TOKEN }} + + - name: Test exit code set in steps-output + id: lychee_exit_code_test + uses: ./ + with: + args: -- inputdoesnotexist + continue-on-error: true + + - name: Check exit code in steps.outputs + run: | + echo "Lychee exit code: ${{ steps.lychee_exit_code_test.outputs.exit_code }}" + if [[ "${{ steps.lychee_exit_code_test.outputs.exit_code }}" == "1" ]]; then + echo "Lychee correctly failed with exit code 1" + else + echo "Unexpected exit code: ${{ steps.lychee_exit_code_test.outputs.exit_code }}" + echo "Expected exit code 1" + exit 1 + fi diff --git a/entrypoint.sh b/entrypoint.sh index deebb9c..ba2a65c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -68,7 +68,7 @@ if [ "${INPUT_FORMAT}" == "markdown" ]; then fi # Pass lychee exit code to next step -echo "lychee_exit_code=$exit_code" >> $GITHUB_ENV +echo "exit_code=$exit_code" >> $GITHUB_OUTPUT # If `fail` is set to `true` (and it is by default), propagate the real exit # value to the workflow runner. This will cause the pipeline to fail on