-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate lychee exit code #145
Conversation
Ever since we moved to a composite action the exit code for lychee didn't work as expected. The reason is that the the output of a step needs to be propagated to an output of the entire action by setting an explicit parameter in the `outputs` section. See https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-actions
- run: ${{ github.action_path }}/entrypoint.sh | ||
- name: Run lychee | ||
run: ${{ github.action_path }}/entrypoint.sh | ||
id: lychee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this id
have to be unique across the entire Github action pipeline? If so, rename to lychee-cli-run
to avoid conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The composite
action docs aren't that helpful at clarifying that. I assume it only needs to be unique within this action.yml
scope.
So I doubt that will be a concern. Easy enough to verify after it's merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Thanks for the review @polarathene. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) | action | patch | `v1.5.0` -> `v1.5.1` | --- ### Release Notes <details> <summary>lycheeverse/lychee-action</summary> ### [`v1.5.1`](https://github.com/lycheeverse/lychee-action/releases/tag/v1.5.1) [Compare Source](https://github.com/lycheeverse/lychee-action/compare/v1.5.0...v1.5.1) #### Summary Bump lychee version to fix some regressions and extend the documentation. #### What's Changed - README: Expand argument table by [@​tooomm](https://github.com/tooomm) in [https://github.com/lycheeverse/lychee-action/pull/143](https://github.com/lycheeverse/lychee-action/pull/143) - Propagate lychee exit code by [@​mre](https://github.com/mre) in [https://github.com/lycheeverse/lychee-action/pull/145](https://github.com/lycheeverse/lychee-action/pull/145) - Bump lychee version to 0.10.1 by [@​mre](https://github.com/mre) in [https://github.com/lycheeverse/lychee-action/pull/150](https://github.com/lycheeverse/lychee-action/pull/150) #### New Contributors - [@​tooomm](https://github.com/tooomm) made their first contribution in [https://github.com/lycheeverse/lychee-action/pull/143](https://github.com/lycheeverse/lychee-action/pull/143) **Full Changelog**: lycheeverse/lychee-action@v1.5.0...v1.5.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/sosiristseng/template-hugo-book). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMjcuNCIsInVwZGF0ZWRJblZlciI6IjMyLjEyNy40In0=-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) | action | patch | `v1.5.0` -> `v1.5.1` | --- ### Release Notes <details> <summary>lycheeverse/lychee-action</summary> ### [`v1.5.1`](https://github.com/lycheeverse/lychee-action/releases/tag/v1.5.1) [Compare Source](https://github.com/lycheeverse/lychee-action/compare/v1.5.0...v1.5.1) #### Summary Bump lychee version to fix some regressions and extend the documentation. #### What's Changed - README: Expand argument table by [@​tooomm](https://github.com/tooomm) in [https://github.com/lycheeverse/lychee-action/pull/143](https://github.com/lycheeverse/lychee-action/pull/143) - Propagate lychee exit code by [@​mre](https://github.com/mre) in [https://github.com/lycheeverse/lychee-action/pull/145](https://github.com/lycheeverse/lychee-action/pull/145) - Bump lychee version to 0.10.1 by [@​mre](https://github.com/mre) in [https://github.com/lycheeverse/lychee-action/pull/150](https://github.com/lycheeverse/lychee-action/pull/150) #### New Contributors - [@​tooomm](https://github.com/tooomm) made their first contribution in [https://github.com/lycheeverse/lychee-action/pull/143](https://github.com/lycheeverse/lychee-action/pull/143) **Full Changelog**: lycheeverse/lychee-action@v1.5.0...v1.5.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/sosiristseng/template-hugo-book). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMjcuNCIsInVwZGF0ZWRJblZlciI6IjMyLjEyNy40In0=-->
This commit also makes sure `outputs.exit_code` is “The exit code returned from Lychee”. `failIfEmpty` no longer changes it to `1`. Relevant docs: - [Setting exit codes for actions - GitHub Docs](https://docs.github.com/en/actions/sharing-automations/creating-actions/setting-exit-codes-for-actions) - [exit - POSIX Programmer's Manual](https://manned.org/exit.1posix) Relates to lycheeverse#86, lycheeverse#128, lycheeverse#145, lycheeverse#245, and lycheeverse#251.
This commit also makes sure `outputs.exit_code` is “The exit code returned from Lychee”. `failIfEmpty` no longer changes it to `1`. Relevant docs: - [Setting exit codes for actions - GitHub Docs](https://docs.github.com/en/actions/sharing-automations/creating-actions/setting-exit-codes-for-actions) - [exit - POSIX Programmer's Manual](https://manned.org/exit.1posix) Relates to lycheeverse#86, lycheeverse#128, lycheeverse#145, lycheeverse#245, and lycheeverse#251.
This commit also makes sure `outputs.exit_code` is “The exit code returned from Lychee”. `failIfEmpty` no longer changes it to `1`. Relevant docs: - [Setting exit codes for actions - GitHub Docs](https://docs.github.com/en/actions/sharing-automations/creating-actions/setting-exit-codes-for-actions) - [exit - POSIX Programmer's Manual](https://manned.org/exit.1posix) Relates to lycheeverse#86, lycheeverse#128, lycheeverse#145, lycheeverse#245, and lycheeverse#251.
This commit also makes sure `outputs.exit_code` is “The exit code returned from Lychee”. `failIfEmpty` no longer changes it to `1`. Relevant docs: - [Setting exit codes for actions - GitHub Docs](https://docs.github.com/en/actions/sharing-automations/creating-actions/setting-exit-codes-for-actions) - [exit - POSIX Programmer's Manual](https://manned.org/exit.1posix) Relates to lycheeverse#86, lycheeverse#128, lycheeverse#145, lycheeverse#245, and lycheeverse#251.
- **fix: Make `fail: false` effective even when `failIfEmpty: true`** This commit also makes sure `outputs.exit_code` is “The exit code returned from Lychee”. `failIfEmpty` no longer changes it to `1`. Relevant docs: - [Setting exit codes for actions - GitHub Docs](https://docs.github.com/en/actions/sharing-automations/creating-actions/setting-exit-codes-for-actions) - [exit - POSIX Programmer's Manual](https://manned.org/exit.1posix) Relates to #86, #128, #145, #245, and #251. - **fix: Update `env.exit_code` to `outputs.exit_code`** 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. Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Ever since we moved to a composite action the exit code for lychee didn't work as expected.
The reason is that the the output of a step needs to be propagated to an output of the entire
action by setting an explicit parameter in the
outputs
section.See https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-actions