Release Please
Reusable automated versioning workflow based on conventional commits. Detects commits on the main branch, creates/updates a Release PR with version bump and CHANGELOG.md, then creates a GitHub Release on merge.
Trigger
yaml
on:
workflow_call:Called via uses: in the repository's release workflow.
Inputs
No inputs are required. Release Please reads its configuration directly from release-please-config.json and .release-please-manifest.json in the calling repository.
Secrets
No additional secrets are required. The workflow uses the default GITHUB_TOKEN via permissions.
Permissions
yaml
permissions:
contents: write
pull-requests: writecontents: write— to create tags and releases.pull-requests: write— to create and update the release PR.
Outputs
| Output | Description |
|---|---|
release_created | 'true' if a release was created in this run |
tag_name | The tag name (e.g. 1.2.3) |
version | The release version |
These outputs are used by subsequent jobs (e.g. post-release, sync-develop) to decide whether to run.
Job: release-please
Runs on ubuntu-latest:
- Runs the
googleapis/release-please-action@v4action. - If there are new conventional commits since the last release:
- Creates or updates a PR with the version bump and changelog.
- When the release PR is merged:
- Creates the Git tag and GitHub Release.
- Sets the
release_created,tag_name, andversionoutputs.
Typical release flow
feat: add new feature ──┐
fix: resolve bug X ├── commits on main
chore: update deps ──┘
│
▼
Release Please detects commits
│
▼
Creates/updates PR "chore: release 1.3.0"
(with updated CHANGELOG.md)
│
▼
Merge the release PR
│
▼
Tag 1.3.0 + GitHub Release created
│
┌──────┴──────┐
▼ ▼
post-release sync-developUsage example
Release Please only
yaml
# .github/workflows/release.yml
name: Release
on:
push:
branches: [main]
jobs:
release-please:
uses: middag-io/.github-private/.github/workflows/release-please.yml@workflows-v1With post-release and sync-develop
yaml
name: Release
on:
push:
branches: [main]
jobs:
release-please:
uses: middag-io/.github-private/.github/workflows/release-please.yml@workflows-v1
post-release:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
uses: middag-io/.github-private/.github/workflows/wp-plugin-post-release.yml@workflows-v1
with:
tag-name: ${{ needs.release-please.outputs.tag_name }}
zip-name: wp-plugin-example
secrets: inherit
sync-develop:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
uses: middag-io/.github-private/.github/workflows/sync-develop.yml@workflows-v1