-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve reporting of errors & efficiency of pr-size-labeler #7288
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3f4087f
Surface curl errors
mhucka 00bcb65
Use echo, not return
mhucka 095cf41
Adjust style of variable references to match existing code
mhucka 5a71671
Fix a couple of mistakes and improve DRYness
mhucka 96b050c
Get rid of token parameter for workflow_dispatch
mhucka 36ec815
Add option to set Bash tracing
mhucka 16b6020
Speed up git checkouts by making them sparse
mhucka 15424d1
Clean up temporary files created in jq_stdin
pavoljuhas 544afab
Rewrite api_call to output response from the server when call fails
pavoljuhas 8c90b02
Terminate early if api_call returns error status
pavoljuhas d6de407
Do not discard stderr from api_call
pavoljuhas 37bf2f6
Switch to a PAT instead of GITHUB_TOKEN
mhucka 5720edd
Add comments to explain some non-obvious parts
mhucka 747fd6a
Merge branch 'main' into mh-fix-size-labeler
mhucka fc7d3dc
Take out pipe
mhucka 0b6c8a5
Go back to using pull_request_target & GITHUB_TOKEN
mhucka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is this used anywhere? If not please delete.
Uh oh!
There was an error while loading. Please reload this page.
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.
Yes, it is. The environment variable is recognized by Bash: https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-SHELLOPTS
Here what's happening is that when the Boolean
trace
is set by usingworkflow_dispatch
, it causes SHELLOPTS to get the valuextrace
. That's the same as usingset -x
: https://www.gnu.org/software/bash/manual/bash.html#index-set. Since the environment variable is set at the job level, all invocations get the SHELLOPTS value. The result is that all the Bash scripts and commands in the workflow get the equivalent ofset -x
, and thus output a trace of their steps. This is useful for debugging.The beauty of this approach is that it doesn't require modifying any of the
run:
commands to addset -x
, and it can be turned on and off at run time.