-
Notifications
You must be signed in to change notification settings - Fork 8.2k
gha/sync-cli-docs: Ignore explicitly closed versions #24101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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