Configure release branches for semantic-release
mainYou can specify which branches trigger a release using the branches input (for semantic-release v16+) or the branch input (for versions older than v16). These inputs override the configuration in your repository's release config file.
For semantic-release v16 and above (branches):
Use the branches input with a YAML list. If not configured, it defaults to:
['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v6
with:
semantic_version: 16
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'master',
'next',
'next-major',
{
name: 'beta',
prerelease: true
},
{
name: 'alpha',
prerelease: true
}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}