Fix gh-pages concurrency race conditions in deploy and preview workflows#13
Merged
Fix gh-pages concurrency race conditions in deploy and preview workflows#13
Conversation
Both preview.yml and deploy.yml write to the gh-pages branch. Using a
per-ref concurrency group (preview-${{ github.ref }}) only serialises
within the same PR, still allowing concurrent writes from different PRs
or different event types, causing rebase conflicts. Use a single shared
`gh-pages` group with cancel-in-progress: false so all writers serialise
while queued runs (like the closed event cleanup) are preserved.
References: Primajin/satellite-tracker#357
Agent-Logs-Url: https://github.com/Primajin/Gyros/sessions/91e33b0a-a6ef-4d47-895b-7941c581610e
Co-authored-by: Primajin <1742115+Primajin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix gh-pages concurrency issues in workflows
Fix gh-pages concurrency race conditions in deploy and preview workflows
May 4, 2026
|
Console Logs✅ No logs were captured |
2026-05-04T11:24:05.455Z-iPad_Pro_landscape-3abf394.png2026-05-04T11:24:05.455Z-iPad_Pro-3abf394.png2026-05-04T11:24:05.455Z-iPhone_13-3abf394.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Both
deploy.ymlandpreview.ymlwrite to thegh-pagesbranch without a shared concurrency guard, allowing concurrent writes that cause rebase conflicts ("remote contains work not present locally").Changes
preview.yml: Replaceconcurrency: preview-${{ github.ref }}with a sharedgh-pagesgroup. The per-ref group only serialises within a single PR — concurrent runs from different PRs, orsynchronizevsclosedevents on the same PR, can still race.deploy.yml: Add concurrency group — previously had no serialisation at all.Both now use:
cancel-in-progress: falseis intentional: dropping queued runs would silently skip theclosed-event cleanup that removes a preview fromgh-pages.References
Primajin/satellite-tracker#357. TheCESIUM_BASE_URLfix from that PR is not applicable here (this repo usesVITE_BASE_PATHinstead).Original prompt
Create a pull request in
Primajin/Gyrosonly if applicable (i.e., only if the repo has GitHub Actions workflows that deploy previews or deploy togh-pagesand could have race conditions from concurrentgh-pageswrites).Reference fix to replicate:
Tasks:
.github/workflows/*for:rossjrw/pr-preview-actionand/orgh-pagesbehavior (e.g.,JamesIves/github-pages-deploy-action,peaceiris/actions-gh-pages, or steps pushing togh-pages).gh-pages, ensure all writers serialize using:Add a short comment explaining why per-ref concurrency is insufficient and why
cancel-in-progress: falsematters.3) Port the
CESIUM_BASE_URLfix from #357 only if this repo has an analogous step/bug (do not introduce CESIUM settings otherwise).4) If no relevant workflow exists, do not open a PR.
Use the repository’s default branch as base. Keep changes minimal and workflow YAML valid. In PR body, reference
Primajin/satellite-tracker#357and explain the race condition briefly.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Primajin/satellite-tracker#357 fixed an issue with concurrent gh pages preview actions. I use this in a couple of my (owner Primajin) repos, could you please open a pr in each repo that uses the gh pages preview or deploy action with the fixes from the above mentioned #357?
Assistant: Yes—I can do that, but I need the list of target repositories (or permission to discover them), then I can open one PR per repo applying the same workflow fix as
Primajin/satellite-tracker#357.What I already have from #357 (the patch to replicate)
gh-pageswriters serialize:CESIUM_BASE_URLstep to usegithub.event.pull_request.number(and proper quoting) in bash.What I need from you
Primajin/<repo>), e.g.Primajin/repo-aPrimajin/repo-brossjrw/pr-preview-actionor agithub-pages-deploy-actiondeploy togh-pages”, or<workflow file path>in each repo” (if you know them).Why I’m asking: I can’t reliably enumerate all repos you “use this in” via the API tool I have here (the endpoint to list your repos isn’t available in this environment), so I need you to provide the repo names (or I can work from a smaller subset).
Once you paste the repo list + confirm the rule above, I’ll open PRs in each repo with the changes from #357.
User: 1. What's the endpoint, so that I can try running it myself
Assistant: The REST endpoint I attempted to use (and which this chat tool reported as unsupported) was:
GET https://api.github.com/users/Primajin/repos?per_page=100&sort=updated(Equivalent in the GitHub REST docs: List repositories for a user.)
You can try it yourself with
curl:Notes:
Authorizationheader, it may still work but you’ll be subject to much lower rate limits.GET https://api.github.com/user/repos?per_page=100&sort=updated(requires auth), e.g.
User: Is there a way to filter the fields to only show the urls via a get param?
Assistant: Yes—using GitHub’s REST API you can reduce payload size, but you generally can’t ask it (via a query param) to return only a single field like
html_url.You have two practical options:
1) Use the
per_page+?params as usual, then extract only URLs client-sideExample with
jq:(Or use
.[].urlfor API URLs.)2) Use the
X-GitHub-Api-Versionheader + a “custom media type” to get a smaller representation (limited)For many endpoints you can request a more compact representation by choosing an appropriate
Acceptheader, but it still won’t be “only URLs”.Related:
fields/ partial response?GitHub’s REST API does not support a general
?fields=/ partial response query parameter like some APIs do. So there isn’t a “get param” to retu...This pull request was created from Copilot chat.