A comment that cannot be posted (no pull request, no token, an API error) is reported with a warning: it never fails the release.
By default, Relizy edits its previous comment on the pull request instead of adding one. To keep it at the bottom of the conversation instead, where the collapsed comments cannot hide it, set prComment.mode to recreate: Relizy posts a new comment and deletes the previous one.
Before the merge, relizy merge-preview posts its own comment, what the merge releases. The release of the merge, which finds the pull request from its commit, rewrites this comment with what it released; the releases of the open pull request (canary, prerelease) keep their own comment.
Relizy looks for the open pull request (GitHub) or merge request (GitLab) whose source branch is the current branch, in the repository of the config (repo, else the repository field of the closest package.json, else the origin remote). Without one, it looks for the pull request of the commit the release started from (before its release commit), merged or not: a job running on the push to main after a merge comments the pull request it merged.
It finds nothing:
for a commit pushed without pull request;
for a pull request opened from a fork, whose commits are not in the repository;
in a GitLab merged results pipeline, whose commit (the merge of the branch into the target) belongs to no merge request.
Give the number with --pr-number in these cases (Bitbucket is not supported, even with --pr-number):
bash
pnpm exec relizy release --yes --pr-number 42
yaml
# GitHub Actions, in a workflow triggered by pull_request- uses: relizy/action@v2 with: args: --pr-number ${{ github.event.pull_request.number }}
Without pull request, the comment is skipped with the warning No PR/MR detected. Use --pr-number to specify one manually. In dry-run, the preview shows PR: Not detected.
The comment uses the token of the provider releases (tokens.github or tokens.gitlab): see Tokens. On GitLab, the job token (CI_JOB_TOKEN) cannot comment the merge requests: set GITLAB_TOKEN.
GitHub: the token needs the permission to comment the pull requests. With the GITHUB_TOKEN of GitHub Actions, grant pull-requests: write to the job (see GitHub Actions).
GitLab: the token is sent in the PRIVATE-TOKEN header: use a project or personal access token with the api scope (see GitLab CI).
A self-hosted instance is reached on the domain of repo (https://<domain>/api/v3 for GitHub Enterprise, https://<domain>/api/v4 for GitLab).
With relizy release, the comment is the summary of the release, the same as the end of the terminal output and the summary of the GitHub Actions run (see release.report):
a title: 🚀 Released <name> <version> (up to 2 versions, else the count of the released packages: 🚀 Released 13 packages of <projectName>), 🧪 Dry run: <name> <version>, ℹ️ Nothing to release or ❌ Release failed with the error;
a short recap: what the release contains (3 features · 2 fixes · 1 contributor), each step that ran with its status and the links of what it created (npm pages, provider releases, tweet; counted beyond 2), the skipped steps left out, the AI rewrites and the install command. The versions and the tags are in the tables of the packages;
the packages and their versions: one table, or one per version group titled with its title, its version and its version mode, the unified/selective group first;
a footer: the branch, the date, and a link to Relizy.
When nothing is released, the comment says so (No commit since the last release triggers a new version.). When the release fails, it shows the error and the steps done before it.
The dry run looks for the pull request (it calls the API of the provider to find it), then shows the comment with the pull request found, the mode and the status. It posts nothing.
PR Comments
Post the summary of each release on the pull request or merge request it comes from, on GitHub and GitLab, with Relizy.
How It Works
relizy releasecomments the pull request as its last step (see the steps of a release), whenrelease.prCommentistrue(the default).--no-pr-commentskips it.relizy pr-commentposts a comment on its own.A comment that cannot be posted (no pull request, no token, an API error) is reported with a warning: it never fails the release.
By default, Relizy edits its previous comment on the pull request instead of adding one. To keep it at the bottom of the conversation instead, where the collapsed comments cannot hide it, set
prComment.modetorecreate: Relizy posts a new comment and deletes the previous one.Before the merge,
relizy merge-previewposts its own comment, what the merge releases. The release of the merge, which finds the pull request from its commit, rewrites this comment with what it released; the releases of the open pull request (canary, prerelease) keep their own comment.Finding the Pull Request
Relizy looks for the open pull request (GitHub) or merge request (GitLab) whose source branch is the current branch, in the repository of the config (
repo, else therepositoryfield of the closestpackage.json, else theoriginremote). Without one, it looks for the pull request of the commit the release started from (before its release commit), merged or not: a job running on the push tomainafter a merge comments the pull request it merged.It finds nothing:
Give the number with
--pr-numberin these cases (Bitbucket is not supported, even with--pr-number):Without pull request, the comment is skipped with the warning
No PR/MR detected. Use --pr-number to specify one manually.In dry-run, the preview showsPR: Not detected.Tokens
The comment uses the token of the provider releases (
tokens.githubortokens.gitlab): see Tokens. On GitLab, the job token (CI_JOB_TOKEN) cannot comment the merge requests: setGITLAB_TOKEN.GITHUB_TOKENof GitHub Actions, grantpull-requests: writeto the job (see GitHub Actions).PRIVATE-TOKENheader: use a project or personal access token with theapiscope (see GitLab CI).A self-hosted instance is reached on the domain of
repo(https://<domain>/api/v3for GitHub Enterprise,https://<domain>/api/v4for GitLab).The Comment of a Release
With
relizy release, the comment is the summary of the release, the same as the end of the terminal output and the summary of the GitHub Actions run (seerelease.report):🚀 Released <name> <version>(up to 2 versions, else the count of the released packages:🚀 Released 13 packages of <projectName>),🧪 Dry run: <name> <version>,ℹ️ Nothing to releaseor❌ Release failedwith the error;3 features · 2 fixes · 1 contributor), each step that ran with its status and the links of what it created (npm pages, provider releases, tweet; counted beyond 2), the skipped steps left out, the AI rewrites and the install command. The versions and the tags are in the tables of the packages;title, its version and its version mode, theunified/selectivegroup first;When nothing is released, the comment says so (
No commit since the last release triggers a new version.). When the release fails, it shows the error and the steps done before it.The private packages are listed only with
monorepo.privatePackages: 'release', and never get an install command: see Private Projects.The Comment of
relizy pr-commentWithout a release,
relizy pr-commentcomments the current state of the project, read from thepackage.jsonfiles:🚀 Release published;package.json(not with theindependentmode), the dist-tag when it is notlatest, the date and the branch;release.publishnotfalse), and of their dist-tag.Dry Run
The dry run looks for the pull request (it calls the API of the provider to find it), then shows the comment with the pull request found, the mode and the status. It posts nothing.
See Also
relizy pr-commentprComment()