Changing running branch for semantic release

Author: mehdihadeliCreated Feb 8, 2023Updated Aug 31, 2026

Hi, I defined possible branches for my releases inner .releaserc.yaml. But because I'm using workflow_run of GitHub action inner my CD workflow, it gives me a default branch for GITHUB_REF GitHub action environment variable, that is not my exactly triggered branch. Currently, semantic-release works with current branch and GITHUB_REF environment variable. Is there any way, when I run npx semantic-release, I pass my desired branch for analyzing semantic-release?

yaml
branches:
   - main
   - '+([0-9])?(.{+([0-9]),x}).x'
   - name: develop
     prerelease: dev
     channel:  dev

Source: semantic-release/semantic-release