Skip to content

ci: enhance pr site preview comment and add concurrency#7

Merged
paul58914080 merged 1 commit intomainfrom
technical/ci-site-preview
Feb 17, 2026
Merged

ci: enhance pr site preview comment and add concurrency#7
paul58914080 merged 1 commit intomainfrom
technical/ci-site-preview

Conversation

@paul58914080
Copy link
Member

Checklist:

Copilot AI review requested due to automatic review settings February 17, 2026 14:41
@paul58914080 paul58914080 requested a review from a team as a code owner February 17, 2026 14:41
@github-actions
Copy link

Site preview available 🔗 https://ff4j.github.io/docs/pr-7/

@paul58914080 paul58914080 merged commit 1ec6bc1 into main Feb 17, 2026
8 checks passed
@paul58914080 paul58914080 deleted the technical/ci-site-preview branch February 17, 2026 14:44
github-actions bot pushed a commit that referenced this pull request Feb 17, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the GitHub Pages PR-preview workflow by preventing overlapping runs, preserving existing content on gh-pages when publishing PR previews, and making the preview link comment idempotent (update instead of spam).

Changes:

  • Add workflow-level concurrency to cancel in-progress runs per ref.
  • Adjust PR preview deploy to target gh-pages explicitly and keep existing files.
  • Update the PR preview comment step to find-and-update an existing comment via a marker.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +65 to +73
const { data: comments } = await github.rest.issues.listComments({
owner,
repo,
issue_number: pr,
body: `📘 **Site preview available**:\n\n${url}`
});

const existing = comments.find(comment =>
comment.body?.includes(marker)
);
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issues.listComments is paginated (default 30). If a PR has more than one page of comments, the marker comment may not be found and this can create duplicate preview comments. Consider requesting a larger per_page and/or paging through results (or using the paginate helper) before deciding whether to create vs update.

Copilot uses AI. Check for mistakes.
Comment on lines 110 to +111
if: github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == false
github.event.action == 'closed'
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup job now runs on every PR close, including merged PRs (previously it skipped merged==true). This changes behavior by deleting merged PR previews as soon as the PR is merged/closed; please confirm that’s intended (and update the PR description if so).

Copilot uses AI. Check for mistakes.
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

Comments