Workflows
ReleaseRay is a step in a workflow you own. This page covers which events it runs on, the example workflows for common release setups, and the permissions each job needs. The quickstart workflow, which runs on every published release, is in the Quickstart.
Every example below is in the repository's examples/workflows folder. They all grant nothing at the workflow level, pin third-party actions to a full commit SHA, and pass values to scripts through env:, never inline.
Choosing a Workflow
| Example | When to use it |
|---|---|
release-notes.yml | The quickstart: on every published release, plus a manual dispatch |
release-notes-hardened.yml | Public repositories that merge outside contributions: the job with the LLM key cannot write, the job that writes never sees the key |
release-notes-on-tag.yml | A pushed tag creates the release and pushes the CHANGELOG entry |
in-release-job.yml | Inside an existing release job whose tags are pushed with GITHUB_TOKEN |
in-release-job-dispatch.yml | Release jobs on workflow_run, which dispatch the quickstart workflow |
release-notes-preview.yml | A weekly draft of unreleased changes; never publishes |
releaseray-tools.yml | preview, doctor, validate-config and migrate-personas on demand |
Events
| Event | What ReleaseRay does |
|---|---|
release (published) | Writes notes for the release's tag, and publishes by default |
push of a tag | Writes notes for the pushed tag, and publishes by default |
push to a branch | Needs the tag passed as to, as in the in-release-job example |
workflow_dispatch | Needs to: a tag, or HEAD for unreleased changes. Publishes only when publish is true |
schedule | Never publishes; to defaults to HEAD |
pull_request | Runs mode: preview only, which never calls the model and never writes |
pull_request_target | Refused: it can run with a write token on behalf of code from a fork |
workflow_run | Refused, for the same reason. Dispatch the release-notes workflow from your release job instead |
Other release actions (created, edited, prereleased) are refused too. Use on: release: types: [published].
Releases and tags created with GITHUB_TOKEN
Pushes, tags and releases made with the workflow's GITHUB_TOKEN start no other workflow. If semantic-release or another job publishes your releases with that token, a release: published workflow never runs. Two ways around it:
- Run ReleaseRay as later steps of the same release job (
in-release-job.yml). - Dispatch the quickstart workflow from that job (
in-release-job-dispatch.yml). Dispatches always start a run, even fromGITHUB_TOKEN.
Also worth knowing: creating or editing a draft release starts nothing, publishing it does; and pushing more than three tags at once starts no tag-push runs.
Inside an Existing Release Job
If your release tool creates and pushes the tag in a job of its own, add ReleaseRay as later steps of that job:
name: Release
on:
push:
branches: [main]
permissions: {}
concurrency:
group: release-${{ github.ref_name }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
pull-requests: read
issues: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # your release tool may need persisted credentials to push its tag
# Replace with your release tool. It must create and push the tag and
# expose it as steps.tagger.outputs.tag ('' when nothing was released).
- id: tagger
run: echo "tag=" >> "$GITHUB_OUTPUT"
- if: steps.tagger.outputs.tag != ''
run: git fetch --tags --force
- if: steps.tagger.outputs.tag != ''
uses: cristobalmitchell/releaseray@v1 # pin to the full commit SHA of the release you use
with:
to: ${{ steps.tagger.outputs.tag }}
publish: "true"
create-release: "true"
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
The event is a branch push, so the tag is passed as to.
Tag Push: Create the Release and Update CHANGELOG.md
A pushed tag creates the GitHub Release and pushes a CHANGELOG entry. This needs outputs.changelog.enabled: true in .releaseray/config.yml.
name: Release notes on tag
on:
push:
tags: ["v*.*.*"]
permissions: {}
concurrency:
group: releaseray-${{ github.ref_name }}
cancel-in-progress: false
jobs:
notes:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write # create the release and push CHANGELOG
pull-requests: read
issues: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.repository.default_branch }} # CHANGELOG.md lives here
fetch-depth: 0 # tags resolve from local refs, whatever is checked out
persist-credentials: false # the push authenticates with github-token itself
- uses: cristobalmitchell/releaseray@v1 # pin to the full commit SHA of the release you use
with:
to: ${{ github.ref_name }}
create-release: "true"
push: "true"
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
If the default branch is protected, GITHUB_TOKEN may not be allowed to push to it. See "When GITHUB_TOKEN Is Not Enough" below, or deliver the entry as a pull request with the CHANGELOG pull request recipe.
Public Repositories: the Hardened Split
On a public repository that merges outside contributions, pull request text is written by people you don't control. The hardened workflow splits the run in two: the job that holds the LLM key has a read-only token, and the job that writes never sees the key.
name: Release notes (hardened)
on:
release:
types: [published]
permissions: {}
concurrency:
group: releaseray-${{ github.event.release.tag_name }}
cancel-in-progress: false
jobs:
generate: # holds the LLM key; read-only token
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
pull-requests: read
issues: read
outputs:
notes-digest: ${{ steps.gen.outputs.notes-digest }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- id: gen
uses: cristobalmitchell/releaseray@v1 # pin to the full commit SHA of the release you use
with:
mode: generate
publish: "false" # generate only; the publish job writes
to: ${{ github.event.release.tag_name }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: releaseray-notes-${{ steps.gen.outputs.notes-digest }}
path: ${{ steps.gen.outputs.notes-dir }}
retention-days: 1
overwrite: true
publish: # can write; never sees the LLM key
needs: generate
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false # depth 1 is enough: publish reads no history
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: releaseray-notes-${{ needs.generate.outputs.notes-digest }}
path: releaseray-notes
- uses: cristobalmitchell/releaseray@v1 # pin to the full commit SHA of the release you use
with:
mode: publish
notes-dir: releaseray-notes
expected-digest: ${{ needs.generate.outputs.notes-digest }}
mode: publish refuses a notes.json whose sha256 differs from the generate job's notes-digest. To have a person approve the notes before they are published, put the publish job in an environment that requires reviewers.
Scheduled Preview
A weekly draft of unreleased changes in the job summary. It calls the model but never publishes: scheduled runs never write to GitHub.
name: Release notes preview
on:
schedule:
- cron: "23 14 * * 1" # Mondays; avoid minute 0, when schedules queue up
permissions: {}
concurrency:
group: releaseray-unreleased
cancel-in-progress: true # safe: this flow writes nothing to GitHub
jobs:
preview:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
pull-requests: read
issues: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: cristobalmitchell/releaseray@v1 # pin to the full commit SHA of the release you use
with:
to: HEAD
publish: "false"
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
The Tools Workflow
releaseray-tools.yml runs the four modes that make no LLM call and no GitHub write, on demand from the Actions tab: preview, doctor, validate-config and migrate-personas. The job has read permissions and no LLM key. See the Action Reference for what each mode does, and copy the file from the repository.
Recipes
Recipes cover what a workflow step can do better than a built-in feature:
- CHANGELOG as a pull request, for branches that require reviews or signed commits. It needs the repository setting "Allow GitHub Actions to create and approve pull requests".
- GitHub App token, to act as a GitHub App you registered: for branches only the App may push to, or when the CHANGELOG commit must start other workflows.
- Notes as an artifact, to keep each run's persona files and
notes.json.
Permissions
Grant nothing at the top level (permissions: {}) and list what each job needs. Listing any scope sets every unlisted scope to none.
| Job | permissions: |
|---|---|
generate without publishing; preview, doctor, validate-config, migrate-personas | contents: read, pull-requests: read, issues: read |
generate with publishing (release events, tag pushes) | contents: write, pull-requests: read, issues: read |
publish job of the hardened split | contents: write |
| A release job that dispatches the release-notes workflow | actions: write |
| Bedrock with OIDC | add id-token: write to the job that calls the model |
| The CHANGELOG pull request recipe | contents: write, pull-requests: write, and the repository setting "Allow GitHub Actions to create and approve pull requests" |
Request budget
Before fetching anything, ReleaseRay reads the token's rate limit and checks that the release fits. A release costs about N + min(L, 100) + 2 REST requests with the default settings, where N is the number of pull requests and L the linked issues: 40 for 25 pull requests, 152 for 100.
| Token | REST requests per hour |
|---|---|
GITHUB_TOKEN on github.com | 1,000 per repository |
GITHUB_TOKEN on GitHub Enterprise Cloud | 15,000 |
| Fine-grained or classic PAT | 5,000, shared with the user's other tokens |
| GitHub App installation token | at least 5,000 |
What happens when a release does not fit is set by github.onBudgetExceeded in the Configuration.
When GITHUB_TOKEN is not enough
Pass a fine-grained PAT, or a token from a GitHub App you register, as the github-token input when:
- The release commit changes
.github/workflows/.GITHUB_TOKENcannot create a release whose target commit changes workflow files. ReleaseRay warns before it tries. Updating an existing release is not affected. - The CHANGELOG branch is protected. A push restriction or ruleset can reject
GITHUB_TOKEN. Branches that require pull requests or signed commits need the CHANGELOG pull request recipe. - The CHANGELOG commit must start other workflows. With a PAT or App token it does; ReleaseRay skips its own commit through a
Generated-by: ReleaseRaytrailer. - The budget is too small. Ranges with hundreds of pull requests and comments turned on can exceed what
GITHUB_TOKENallows.
The repository's token guide has the details, including the commit identity for App tokens.
Related docs: