Work around 403s when synchronizing the mailing list mirror #18
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.
Authorization is hard. So hard, in fact, that it seems that (maybe due to incorrect optimizations?) pushes to GitHub with an installation access token that has just been obtained sometimes fail with a 403, even though it seems that a re-run "fixes" the problem.
The first instances of this problem happened on Sep 8, 2025, 9:52 AM GMT+2:
This happened relatively shortly after I had merged #12 on Sep 5, 2025, 7:55 AM GMT+2, and there were 30 such occurrences of denied pushes due to apparently not-yet-valid installation tokens in https://github.com/gitgitgadget-workflows/gitgitgadget-workflows/actions/workflows/sync-mailing-list-mirror.yml (which isn't bad, given that there have been 1,892 runs of that workflow since Sep 5, 8:44 AM GMT+2, as of time of writing).
So it might seem as if the flake has something to do with this change, but then, it occurs too rarely to be caused by that change, and it seems to happen a tad more frequently than once a day but started 3 days after merging that PR. As I stated above, I have come to the conclusion that it is something on GitHub's side where they changed something on their side that sometimes lets installation access tokens be not quite ready for pushing for a little while right after the tokens have been issued.
Corroborating evidence for that suspicion are the 8 occurrences of the same issue in the sister repository I established for Cygwin. And in that repository, essentially the same workflow had been running a quite a few days longer without any issues, more concretely, it has done its job without problems since Aug 30, 2025, 6:40 PM GMT+2 until it failed for the first time on Sep 22, 2025, 7:24 PM GMT+2 with the same 403.
Let's just work around that by trying again to push, if necessary a couple of times (with a back-off strategy).