Skip to content

Commit 9f7befe

Browse files
kytrinyxBethanyG
authored andcommitted
Fail closed on pause contributions workflow
In the original workflow, I had `catch(err) => false`. But during code review the question was raised: What happens if we get rate limited and all the requests from the API fail? (E.g. if we do a script and automatically create PRs across all of Exercism, which is totally a thing). We were like: ooh, that would suck, wouldn’t it? It would be better if we occasionally had to deal with manually closing a PR. But here’s the kicker. The API response has no body. It’s either 204 or 404, where 404 is perceived as… an error. So I changed it, and (importantly) forgot to test the script one final time. So here is a version that will actually work. (I tested.)
1 parent 3b7ac87 commit 9f7befe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/pause-community-contributions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
org: context.repo.owner,
3131
username: context.actor,
3232
}).then(response => response.status == 204)
33-
.catch(err => true);
33+
.catch(err => false);
3434
- name: Comment
3535
if: steps.is-organization-member.outputs.result == 'false'
3636
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0

0 commit comments

Comments
 (0)