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 warn-on-failure #286

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add warn-on-failure #286

wants to merge 3 commits into from

Conversation

jsoref
Copy link

@jsoref jsoref commented Jan 30, 2024

Some users might not want their workflow jobs to die just because an artifact isn't available...

fixes #285
closes #42, closes #208, closes #254

@jsoref jsoref requested a review from a team as a code owner January 30, 2024 21:41
Comment on lines +146 to +149
core.setOutput(
'failure',
`Unable to download artifact(s): ${err.message}`
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using a warning annotation instead? https://github.com/actions/toolkit/tree/main/packages/core#annotations

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Because I can't as a consuming action or a consuming workflow retrieve that without extra permissions and fishing through the logs.

If I'm the consuming action/workflow, I can use the output and then produce my own annotation if I decide it's relevant to my use case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For demonstration purposes, I could include that in the test.yml to show that it works...

Some users might not want their workflow jobs to die just because an
artifact isn't available...
Comment on lines +136 to +142
- name: Log missing warning
env:
output: ${{ steps.request-missing-artifact.outputs.failure }}
run_os: ${{ matrix.runs-on }}
run: |
echo "::notice title=This message is expected::[$run_os] $output"
shell: bash
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This demonstrates the ability for consuming workflows to take advantage of the output and report it in whichever way they see fit.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot_20240201-081150.png

@jsoref jsoref requested a review from robherley February 8, 2024 21:31
@rmarquis
Copy link

Is this ever going to be reviewed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support mapping failures to an output Is it possible to not fail the workflow if the artifact doesn't exist?
3 participants