|
38 | 38 | uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
39 | 39 | with:
|
40 | 40 | retries: 5 # retry GitHub API requests up to 5 times, with exponential backoff
|
41 |
| - retry-exempt-status-codes: 403 |
| 41 | + retry-exempt-status-codes: "403,404" |
| 42 | + # In the above list: |
| 43 | + # |
| 44 | + # - 404 is in the list because we will always hit a 404 when the PR author is not |
| 45 | + # a committer. This 404 is normal and expected. |
42 | 46 | script: |
|
43 | 47 | const oldPrAssignees = context.payload.pull_request.assignees
|
44 | 48 | .map(obj => obj.login)
|
|
55 | 59 | headers: {
|
56 | 60 | 'X-GitHub-Api-Version': '2022-11-28'
|
57 | 61 | }
|
58 |
| - }) |
| 62 | + }).catch((error) => { |
| 63 | + // So, I'm not sure if the error is being thrown by `@octokit/request.js` or |
| 64 | + // `@octokit/plugin-retry.js`. I suspect that the initial error is thrown by |
| 65 | + // `request.js`, and is subsequently propagated by `plugin-retry.js`. |
| 66 | + // |
| 67 | + // Anyway, the docs for `request.js` say the following: |
| 68 | + // |
| 69 | + // > If an error occurs, the promise is rejected with an `error` object |
| 70 | + //> containing 3 keys to help with debugging: |
| 71 | + // > |
| 72 | + // > - `error.status` The http response status code |
| 73 | + // > - `error.request` The request options such as `method`, `url` and `data` |
| 74 | + // > - `error.response` The http response object with `url`, `headers`, and `data` |
| 75 | + // |
| 76 | + // Source: https://github.com/octokit/request.js/blob/main/README.md#request |
| 77 | + // |
| 78 | + // So, inside this `.catch()`, we simply return that `error` object. |
| 79 | +
|
| 80 | + return error; |
| 81 | + }); |
59 | 82 | if (isCollaboratorResponseObj.status == 204) {
|
60 | 83 | var isCollaborator = true;
|
61 | 84 | } else if (isCollaboratorResponseObj.status == 404) {
|
|
0 commit comments