gha/sync-cli-docs: Ignore explicitly closed versions#24101
gha/sync-cli-docs: Ignore explicitly closed versions#24101vvoland wants to merge 1 commit intodocker:mainfrom
Conversation
Avoid repeatedly opening new PRs for the same CLI version when a previous one was intentionally closed. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Documentation Review Summary
Found 2 issues in the workflow documentation that could improve clarity for future maintainers. These relate to comment and message clarity in the new closed PR detection logic.
While the code logic is sound, adding more context to the comments and messages would help future maintainers understand the intentional design decision to prevent reopening previously closed PRs.
| git push -u origin "$BRANCH_NAME" --force | ||
| gh pr edit "$EXISTING_PR" --title "$PR_TITLE" --body "$PR_BODY" | ||
| else | ||
| # Check if a closed PR with the same title already exists |
There was a problem hiding this comment.
Comment could be more informative
The comment describes what is being checked but not why it's necessary. Consider clarifying the intent:
| # Check if a closed PR with the same title already exists | |
| # Check if a closed PR with the same title already exists (avoid reopening intentionally closed PRs) |
This helps future maintainers understand that closed PRs represent an intentional decision, not just a past state.
| # Check if a closed PR with the same title already exists | ||
| CLOSED_PR=$(gh pr list --state closed --search "$PR_TITLE in:title" --json url --jq ".[0].url // empty") | ||
| if [ -n "$CLOSED_PR" ]; then | ||
| echo "A closed PR already exists for this version: $CLOSED_PR" >> "$GITHUB_STEP_SUMMARY" |
There was a problem hiding this comment.
Message could be clearer for workflow debugging
The current message doesn't explicitly state what action is being taken. Consider making it more explicit:
| echo "A closed PR already exists for this version: $CLOSED_PR" >> "$GITHUB_STEP_SUMMARY" | |
| echo "Skipping PR creation: closed PR already exists for this version: $CLOSED_PR" >> "$GITHUB_STEP_SUMMARY" |
This immediately tells someone viewing the workflow summary what happened and why, improving debugging experience.
Avoid repeatedly opening new PRs for the same CLI version when a previous one was intentionally closed.
Description
Related issues or tickets
Reviews