Commit f085651
Improve reporting of errors & efficiency of pr-size-labeler (#7288)
* Surface curl errors
Errors in the invocation of `curl` were not being reported. Added `-f`
flag to `curl`, return status checking, and printing the response body
in case of errors.
* Use echo, not return
* Adjust style of variable references to match existing code
* Fix a couple of mistakes and improve DRYness
- `cat` should have been `echo`
- remove debugging setting
- refactor a few lines in api_call()
* Get rid of token parameter for workflow_dispatch
I never seem to need it.
* Add option to set Bash tracing
This approach is a simple way to debug all shell scripts and commands.
* Speed up git checkouts by making them sparse
* Clean up temporary files created in jq_stdin
And make sure it still returns the jq status code.
* Rewrite api_call to output response from the server when call fails
Write error response to stderr as stdout may be captured by the caller.
Use `cat` for outputting response as `echo` may translate escape sequences.
Make sure api_call returns the curl status code.
* Terminate early if api_call returns error status
Avoid using `cmd <<<"$(api_call args)"` expressions which ignore
`api_call` failure.
* Do not discard stderr from api_call
This is where it sends diagnostics if any.
* Switch to a PAT instead of GITHUB_TOKEN
Once again, got bitten by the fact that adding labels to an issue
doesn't work with `GITHUB_TOKEN`
C.f. https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue
* Add comments to explain some non-obvious parts
This is for future readers.
* Take out pipe
Per [review comments by
@Pavol](#7288 (comment)),
it is not doing what I thought it was doing. Plus, we don't really need the
final output step.
* Go back to using pull_request_target & GITHUB_TOKEN
---------
Co-authored-by: Pavol Juhas <juhas@google.com>1 parent 4fa82fb commit f085651
File tree
2 files changed
+42
-22
lines changed- .github/workflows
- dev_tools/ci
2 files changed
+42
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| 87 | + | |
| 88 | + | |
84 | 89 | | |
85 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
91 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
92 | 109 | | |
93 | 110 | | |
94 | 111 | | |
95 | 112 | | |
96 | 113 | | |
| 114 | + | |
97 | 115 | | |
98 | 116 | | |
99 | | - | |
| 117 | + | |
| 118 | + | |
100 | 119 | | |
101 | 120 | | |
102 | 121 | | |
| |||
131 | 150 | | |
132 | 151 | | |
133 | 152 | | |
| 153 | + | |
134 | 154 | | |
135 | | - | |
| 155 | + | |
| 156 | + | |
136 | 157 | | |
137 | 158 | | |
138 | 159 | | |
| |||
147 | 168 | | |
148 | 169 | | |
149 | 170 | | |
150 | | - | |
| 171 | + | |
151 | 172 | | |
152 | 173 | | |
153 | 174 | | |
| |||
194 | 215 | | |
195 | 216 | | |
196 | 217 | | |
197 | | - | |
| 218 | + | |
198 | 219 | | |
199 | 220 | | |
200 | 221 | | |
| |||
0 commit comments