Performance improvement on branch configuration

Author: warri93Created Mar 21, 2025Updated Apr 29, 2026
Labelsbug

Current behavior

Hi,

We are currently using the @semantic-release/github action for our release step. Unfortunately, this action takes around 17 minutes to complete. After investigating the issue, we discovered that the Semantic Release plugin scans all branches for which our workflow runs. Since we have quite a few release branches, this makes the step slow.

To speed this up, we tried specifying it to check only our main branch, which significantly reduced the runtime. However, our workflow needs to run for main, beta branches, and release branches, so limiting it to only the main branch isn’t sufficient.

After some research and testing, we found that adding the following configuration to the plugin reduces the duration to just 1.5 minutes, which is a massive improvement. We realized that we don’t need to scan all branches, checking the main branch and the branch on which the workflow is running (github.ref) is enough:

extra_plugins: |
 @semantic-release/github@^10.0.7
semantic_version: ^24.0.0
branches: |
 [
  'main',
  {
   name: "${{ github.ref }}",
   prerelease: true
  }
 ]

We tested this approach, and it seemed to work as expected. Our release flow takes 1.5 minutes if we pin it to the main branch and current branch.

However, this means that we would need to create the correct config file if we want to do a release, which adds complexity to when and how to choose the correct config file. This is something we would like to prevent.

We’re wondering if we’re overlooking something with this approach. If the release process has enough information based on the main branch and the current ref, why does the default release process scan all other branches that match the configuration?

Thanks in advance for your insights!

Best regards

Expected behavior

Do not scan all branches to speed up this step significantly.

semantic-release version

24.2.3

CI environment

GitHub actions

Plugins used

semantic-release/github@^10.0.7

semantic-release configuration

- name: Semantic Release
        id: semantic
        uses: cycjimmy/semantic-release-action@v4
        with:
          extra_plugins: |
            @semantic-release/github@^10.0.7
          semantic_version: ^24.0.0
          branches: |
            [
              'main',
              {
                  name: "${{ github.ref }}",
                  prerelease: true
              }
            ]

CI logs

Source: semantic-release/semantic-release