Skip to content

ci(pr): post extension download link on PR builds#29

Open
calthejuggler wants to merge 2 commits into
mainfrom
ci/pr-build-comment
Open

ci(pr): post extension download link on PR builds#29
calthejuggler wants to merge 2 commits into
mainfrom
ci/pr-build-comment

Conversation

@calthejuggler
Copy link
Copy Markdown

@calthejuggler calthejuggler commented May 19, 2026

Summary

  • Adds a step to the CI build job that posts a comment on the PR with a direct download link to the built extension artifact
  • Reviewers can download, unzip, and load the extension in Chrome without checking out the branch
  • On subsequent pushes, the comment is updated in place (no spam)

Test plan

  • Open a test PR and verify the build job posts a comment with the download link
  • Push another commit and verify the existing comment is updated, not duplicated
  • Click the download link and confirm the artifact downloads correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • CI updated to automatically post and update a single pull request comment containing the build artifact download link and build/run metadata.
    • Prevents duplicate comments by updating the existing entry.
    • Explicit permissions added so the workflow can create or update PR comments and make artifact links available directly in the pull request.

Review Change Stack

Add a step to the CI build job that comments on the PR with a direct
download link to the built extension artifact, so reviewers can install
it without checking out the branch locally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1b8e104c-d5d6-4e25-beb1-cf4f1376a390

📥 Commits

Reviewing files that changed from the base of the PR and between fc4c7bd and 2f6bd6a.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

Walkthrough

This pull request updates the CI workflow to declare pull-requests: write, gives the extension artifact upload step an id, and adds an actions/github-script step that lists PR comments, searches for a fixed HTML marker, and updates that comment or creates a new one with the artifact download link and workflow run metadata.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit peeks at CI’s light,

Leaves a note when builds take flight,
“Here’s the artifact, fresh and neat,”
A hop, a link, a tidy feat,
Reviewers grin — no more sleight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a CI step that posts the extension download link as a PR comment when builds complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/pr-build-comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Extension build ready for testing

Download the build, unzip it, then load it as an unpacked extension at chrome://extensions (enable Developer Mode first).

Download extension-build

Built from 93e0068workflow run

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 7-9: The workflow-level permissions block currently sets only
pull-requests: write which causes unspecified scopes to default to none and
breaks actions/checkout@v4; update the permissions map in the CI workflow to
include contents: read alongside pull-requests: write so the checkout step can
read repository contents (i.e., add "contents: read" under the existing
permissions stanza).
- Around line 71-77: The code uses github.rest.issues.listComments which only
returns the first page (30) so the marker search can miss comments; replace the
single-page fetch with a paginated fetch (e.g., use github.paginate or loop over
pages) to collect all comments before searching. Specifically, call
github.paginate(github.rest.issues.listComments, { owner: context.repo.owner,
repo: context.repo.repo, issue_number: context.issue.number }) (or equivalent
paging loop), then search the resulting array for c.body.includes(marker) and
assign to existing, keeping the same marker/context variables and downstream
logic.
- Around line 54-93: The PR comment step ("Comment on PR with download link")
fails for forked PRs because the GITHUB_TOKEN is read-only; guard the step by
adding a conditional that skips it for forked PRs (e.g. add if:
github.event.pull_request.head.repo.fork == false or if:
github.event.pull_request.head.repo.full_name == github.repository) so the
script calling github.rest.issues.createComment and
github.rest.issues.updateComment only runs when the PR originates from the same
repo.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c976f03c-8c20-4d6d-bf15-5c759436fc57

📥 Commits

Reviewing files that changed from the base of the PR and between ad20d26 and fc4c7bd.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
- Add contents: read to workflow permissions so checkout works
  regardless of repo-level GITHUB_TOKEN defaults
- Skip comment step on fork PRs where the token is read-only
- Use github.paginate for comment listing to avoid missing the
  marker on PRs with 30+ comments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@calthejuggler calthejuggler marked this pull request as ready for review May 19, 2026 10:48
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