Skip to content

fix(ci): prevent duplicate PRs in publish-docs workflow - #149

Open
etserend wants to merge 2 commits into
mainfrom
fix/publish-docs-duplicate-prs
Open

fix(ci): prevent duplicate PRs in publish-docs workflow#149
etserend wants to merge 2 commits into
mainfrom
fix/publish-docs-duplicate-prs

Conversation

@etserend

@etserend etserend commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Use a static branch name (feat/update-docs-${GITHUB_REF_NAME}) instead of a run_id-suffixed one, so re-runs update the same branch
  • Force-push to update the existing branch on each run
  • Check for an existing open PR before calling gh pr create, and skip creation if one already exists

This applies the same pattern fixed in PR #139 (regenerate-api-client.yaml) to the publish-docs workflow.

Test plan

  • Trigger the workflow twice from the same branch — second run should update the existing PR, not open a new one
  • Verify the generated docs are correctly committed to the docs branch

🤖 Generated with Claude Code

Use a static branch name instead of run_id-suffixed branches so
re-runs update the existing PR via force-push rather than opening
new ones.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Use --allow-empty so every run force-pushes to the static branch and
the "Create PR" step always runs, keeping the PR's last-updated time
current regardless of whether docs content changed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant