cycjimmy / semantic-release-action

GitHub Action for Semantic Release
https://github.com/marketplace/actions/action-for-semantic-release
MIT License
550 stars 98 forks source link

Allow main as default branch #125

Closed nickserv closed 9 months ago

nickserv commented 2 years ago

Describe the bug See https://github.com/semantic-release/semantic-release/issues/1581

Workflow N/A

Expected behavior Repository with main branch is released automatically.

Additional context Repository with main branch is not released automatically.

cycjimmy commented 2 years ago

I still think it should stay the same as the semantic-release configuration for now. And we can manually add the main branch to the workflow file to meet our needs. For example:

steps:
  - name: Semantic Release
    uses: cycjimmy/semantic-release-action@v3
    with:
      branches: |    
        [
          '+([0-9])?(.{+([0-9]),x}).x',
          'master', 
          'main', 
          'next', 
          'next-major', 
          {
            name: 'beta', 
            prerelease: true
          }, 
          {
            name: 'alpha', 
            prerelease: true
          }
        ]
...
kddsultan commented 1 year ago

@cycjimmy,

Does the above config release prerelease for main?

adrianschmidt commented 11 months ago

Does the above config release prerelease for main?

No, that config would create a regular release on either main or master. But if you have both a main and a master branch, semantic-release should detect that there are two existing branches on which the same release could potentially be created, and refuse to create a release.