Skip to content

Commit

Permalink
fix: Update env.exit_code to outputs.exit_code
Browse files Browse the repository at this point in the history
The previous expression always gives `false`.
Both `env.exit_code` and `env.lychee_exit_code` are `null`, probably since the docker→composite refactor #128. When GitHub evaluates the expression, it finds the types do not match, and coerces them to number, namely, `null` → `0`.

See [Evaluate expressions in workflows and actions - GitHub Docs](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#operators).

Relates to #253.
  • Loading branch information
YDX-2147483647 committed Nov 5, 2024
1 parent fabf016 commit f484cb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: Link Checker
id: lychee
uses: ./ # Uses an action in the root directory
with:
args: --user-agent "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" --verbose --exclude spinroot.com --no-progress './**/*.md' './**/*.html' './**/*.rst'
Expand All @@ -23,7 +24,7 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Create Issue From File
if: env.exit_code != 0
if: ${{ steps.lychee.outputs.exit_code }} != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: lycheeverse/lychee-action@v2

- name: Create Issue From File
if: env.exit_code != 0
if: ${{ steps.lychee.outputs.exit_code }} != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
Expand Down

0 comments on commit f484cb5

Please sign in to comment.