ci: post sticky PR comment with .mcpb build link#129
Open
vasylenko wants to merge 5 commits into
Open
Conversation
Adds a step to build-bundle-pr.yml that posts (or updates on subsequent pushes) a single comment on the PR with a download link to the freshly built .mcpb bundle, the build version, short SHA, and run link. Identity is anchored by an HTML-comment marker so the comment is durable across pushes and never duplicates. Uses only the pre-installed gh CLI on ubuntu-latest — no third-party actions. Permissions widened by exactly pull-requests: write.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
MCPB build for this PR
Artifact retained 14 days. This comment auto-updates on each push. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a CI step that posts a single sticky comment on each PR with a download link to the freshly-built .mcpb artifact, version, short SHA, and run link. The comment is anchored by an HTML-comment marker so subsequent pushes update the same comment rather than creating new ones.
Changes:
- Grants
pull-requests: writeto the build job and gives the upload step anidso itsartifact-urloutput can be referenced. - Adds a "Post or update PR build comment" step that builds a Markdown body from env-injected values and uses
gh apito either PATCH an existing marker-tagged comment or POST a new one.
Empty commit to exercise the PATCH branch of the new Post or update PR build comment step. Will be amended out or kept in the merge depending on review; safe to drop.
Fork-origin pull_request runs get a read-only GITHUB_TOKEN regardless of the permissions: block, so the comment step would 403 and paint a red x on every external-contributor PR. Guard the step with a same-repo check; artifact link stays reachable from the Actions run page.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
.mcpb, plus version, short SHA, and run link.Why
Before this, grabbing a PR build meant clicking into the Actions tab, finding the run, and scrolling to the artifacts list. This makes the link one click from the PR conversation.
This PR is its own test fixture: after it lands as an open PR, the workflow on this branch's head runs against itself. Expected behavior on a second push is the same comment ID updated in place (
updated_at > created_at, count of marker-tagged bot comments stays at 1).--