Skip to content
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

Add failIfEmpty argument (fixes #84) #86

Merged
merged 8 commits into from
Apr 25, 2024
Merged

Add failIfEmpty argument (fixes #84) #86

merged 8 commits into from
Apr 25, 2024

Conversation

mre
Copy link
Member

@mre mre commented Mar 2, 2022

If no links were found during a run, this could indicate a configuration
issue. In order to warn users, this new option allows failing the pipeline
in such a scenario.
I'm planning to merge this as part of v2.0.0 and it will be on by default.

See #84

@mre mre added the 2.0 label Mar 10, 2022
@mre mre changed the title Add fail if empty argument (fixes #84) Add failIfEmpty argument (fixes #84) Mar 10, 2022
mre and others added 5 commits April 25, 2024 13:31

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
If no links were found during a run, this could indicate a configuration
issue. In order to warn users, this new option allows failing the pipeline
in such a scenario.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@mre mre force-pushed the fail-if-empty branch 2 times, most recently from b5dcd3f to eb1a7d3 Compare April 25, 2024 11:36

Verified

This commit was signed with the committer’s verified signature.
andrzej-stencel Andrzej Stencel
@mre mre force-pushed the fail-if-empty branch 3 times, most recently from eaaf43c to d4d9def Compare April 25, 2024 12:14
@mre mre merged commit ad3b13a into master Apr 25, 2024
4 checks passed
@mre mre deleted the fail-if-empty branch April 25, 2024 12:38
@mre
Copy link
Member Author

mre commented Apr 25, 2024

Will leave that in master for a bit and then cut a v2 for this.

YDX-2147483647 added a commit to YDX-2147483647/lychee-action that referenced this pull request Nov 5, 2024

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
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.
YDX-2147483647 added a commit to YDX-2147483647/lychee-action that referenced this pull request Nov 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.
YDX-2147483647 added a commit to YDX-2147483647/lychee-action that referenced this pull request Nov 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.
YDX-2147483647 added a commit to YDX-2147483647/lychee-action that referenced this pull request Nov 5, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
AustinAbro321 Austin Abro
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.
mre pushed a commit that referenced this pull request Nov 7, 2024
-   **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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant