-
Notifications
You must be signed in to change notification settings - Fork 2
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 callback to log the ERROR status for the error job #14
Conversation
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.
I've been wondering if we could do something like this! I can't say I'm a fan of how GitHub defines these semantics (specifically, in the absence of a directive named "continue-on-error", I would expect the Workflow to abort on error), but a quick review of the relevant docs suggests that this is indeed how one is supposed to express this logic.
@@ -193,6 +201,7 @@ jobs: | |||
|
|||
- name: upload *.{log,png} | |||
uses: actions/upload-artifact@v4 | |||
if: always() |
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.
if: always() | |
if: ${{ always() }} |
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.
I actually believe it's preferred to not use the expression syntax for always by itself.
I seem to recall reading old issues saying that using the expression syntax with one of these alone was actually causing errors
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.
Actually - my memory was slightly incorrect, seems you can omit the expression syntax entirely.
https://github.com/bocoup/aria-at-gh-actions-helper/actions/runs/8472751048/job/23215516701 is a test run with no expression braces at all
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.
My preference is for the most consistent syntax even at the expense of verbosity for the same reason I don't lean on ASI when writing JS--honoring the exceptions results in more cognitive load and more risk than I think is warranted. I'm willing to be flexible on a few lines, though.
Noticed that there was a possibility of logging the ERROR status in the current app deploy so upgrading the new workflow to have a branch near the end to log ERROR instead of COMPLETED