Publishes the semrel release to GitHub Releases.
This plugin is distributed as the standalone Go binary semrel-plugin-provider-github. Semrel executes the binary as a subprocess, provides plugin configuration through SEMREL_PLUGIN_* environment variables, provides release context through SEMREL_* environment variables, reads standard output, and treats exit code 0 as success and any non-zero exit code as failure. Install the binary in ~/.semrel/plugins/ or anywhere on your $PATH.
go install github.com/SemRels/provider-github/cmd/plugin@latestPre-built, multi-platform images (linux/amd64, linux/arm64) are published to the GitHub Container Registry on every release:
docker pull ghcr.io/semrels/provider-github:latestImages are signed with cosign and include a full SBOM attestation. Verify the signature:
cosign verify ghcr.io/semrels/provider-github:latest \
--certificate-identity-regexp 'https://github.com/SemRels/provider-github/.github/workflows/release.yml.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.complugins:
- name: provider-github
path: ~/.semrel/plugins/semrel-plugin-provider-github
env:
SEMREL_PLUGIN_TOKEN: "${GITHUB_TOKEN}"
SEMREL_PLUGIN_OWNER: "SemRels"
SEMREL_PLUGIN_REPO: "provider-github"
SEMREL_PLUGIN_DRAFT: "false"
SEMREL_PLUGIN_PRERELEASE: "false"
SEMREL_PLUGIN_ASSETS: "dist/*.tar.gz,dist/*.zip,build/myapp"
SEMREL_PLUGIN_COMMENT_ON_PRS: "true"| Name | Required | Description | Default |
|---|---|---|---|
SEMREL_PLUGIN_TOKEN |
Required | GitHub token with repo scope (falls back to GITHUB_TOKEN). |
None |
SEMREL_PLUGIN_OWNER |
Optional | Repository owner. Defaults from GITHUB_REPOSITORY or the git remote when available. |
Derived from git remote |
SEMREL_PLUGIN_REPO |
Optional | Repository name. Defaults from GITHUB_REPOSITORY or the git remote when available. |
Derived from git remote |
SEMREL_PLUGIN_BASE_URL |
Optional | GitHub API base URL (highest priority override). | https://api.github.com |
SEMREL_PLUGIN_API_URL |
Optional | GitHub API base URL alias (used when SEMREL_PLUGIN_BASE_URL is not set). |
https://api.github.com |
SEMREL_PLUGIN_CA_CERT |
Optional | Path to a PEM-encoded CA certificate bundle added to the HTTP client's trusted roots. | None |
SEMREL_PLUGIN_INSECURE_SKIP_VERIFY |
Optional | Skip TLS certificate verification (true/1). Use only as a last resort. |
false |
SEMREL_PLUGIN_DRAFT |
Optional | Create the release as a draft. | false |
SEMREL_PLUGIN_PRERELEASE |
Optional | Mark the release as a prerelease. | false |
SEMREL_PLUGIN_ASSETS |
Optional | Comma-separated file paths or glob patterns to upload as GitHub Release assets. | None |
SEMREL_PLUGIN_COMMENT_ON_PRS |
Optional | Add an idempotent comment to pull requests included in the release. Defaults to true; set to false to disable. The token needs pull-request read and issue-comment write permissions. |
true |
| Variable | Description |
|---|---|
SEMREL_VERSION |
Resolved release version for the current run. |
SEMREL_TAG_NAME |
Git tag name semrel will create or publish. |
SEMREL_NEXT_VERSION |
Next version computed by semrel for the release. |
SEMREL_CHANGELOG |
Generated changelog text for the release. |
SEMREL_DRY_RUN |
Whether semrel is running in dry-run mode. |
GITHUB_API_URL |
Automatically used as the API base URL in GitHub Actions (including GitHub Enterprise Server) when SEMREL_PLUGIN_BASE_URL and SEMREL_PLUGIN_API_URL are not set. |
GITHUB_REPOSITORY |
Fallback owner/repo when SEMREL_PLUGIN_OWNER / SEMREL_PLUGIN_REPO are not set. |
GITHUB_TOKEN |
Fallback token when SEMREL_PLUGIN_TOKEN is not set. |
provider-github supports GitHub Enterprise Server (GHES) and GitHub Enterprise Cloud with data residency (*.ghe.com) out of the box:
- API URL resolution order:
SEMREL_PLUGIN_BASE_URL→SEMREL_PLUGIN_API_URL→GITHUB_API_URL→https://api.github.com. Inside GitHub Actions on GHES,GITHUB_API_URL(for examplehttps://ghe.example.com/api/v3) is picked up automatically. - Endpoint & upload routing:
/api/v3prefixes and trailing slashes are preserved when resolving endpoints, and release asset uploads use theupload_urlreturned by the release response (or/api/uploads//uploads.<subdomain>.ghe.comfallback). - API version header:
X-GitHub-Api-Versionis sent only toapi.github.comand*.ghe.comhosts so older GHES versions that do not recognize the header are not rejected. - Custom CA / self-signed certificates: Set
SEMREL_PLUGIN_CA_CERT=/path/to/ca-bundle.pemto trust an internal or self-signed CA certificate bundle. As a last resort,SEMREL_PLUGIN_INSECURE_SKIP_VERIFY=truedisables TLS verification.
plugins:
- name: provider-github
path: ~/.semrel/plugins/semrel-plugin-provider-github
env:
SEMREL_PLUGIN_TOKEN: "${GITHUB_TOKEN}"
SEMREL_PLUGIN_BASE_URL: "https://ghe.example.com/api/v3"
SEMREL_PLUGIN_CA_CERT: "/etc/ssl/certs/internal-ca.pem"The plugin creates a GitHub release for the current tag, publishes the changelog as release notes, and can upload matching assets listed in SEMREL_PLUGIN_ASSETS. By default it finds pull requests associated with commits since the previous release and comments with a link to the new release. Set SEMREL_PLUGIN_COMMENT_ON_PRS to false to disable comments. Re-running the same release does not duplicate comments.
Examples:
SEMREL_PLUGIN_ASSETS=dist/*.tar.gz,dist/*.zip,build/myappApache-2.0