gh-action-mutex icon indicating copy to clipboard operation
gh-action-mutex copied to clipboard

403 recieved when creating mutex should not be retried

Open leemeador opened this issue 1 year ago • 1 comments

Currently:

When the token supplied does not have permission to create the mutex thingy in the repo, the call to the github api returns HTTP 403 (forbidden). Then the action waits a bit and reties and it still does not have permission. This will repeat for, literally, hours until someone notices and cancels.

Suggested:

When the action code recieves a 403, that would fail the action. (Perhaps 401 (unauthorized) too but I haven't seen a 401.)

Related note:

We are seeing this when the mutex is trying to be set from a fork. Our settings do not allow forks to access our secrets. I suspect a similar thing would happen if the default token was used since it would not have write permission in a fork.

The same thing could happen if a token expired.

leemeador avatar Nov 06 '23 17:11 leemeador

Thanks for the suggestion! For the record, https://github.com/ben-z/gh-action-mutex/issues/4 seems related and could alleviate this situation too.

ben-z avatar Dec 12 '23 20:12 ben-z