jpoehnelt/semantic-release-replace-plugin

Feature request to target only specific branches

dgroh opened this issue · 1 comments

dgroh commented

Hello guys,

thanks for the brilliant plugin.

We are trying to target the changes only for a specific branch. My suggestion would be to have.

        - files:
            - AssemblyInfo.cs
          from: '\[assembly: AssemblyVersion\(".+"\)\]'
          to: '[assembly: AssemblyVersion("${nextRelease.version}")]'
          branches:
            - master
          results:
            - file: AssemblyInfo.cs
              hasChanged: true
              numMatches: 1
              numReplacements: 1
          countMatches: true

Is there a workaround for this right now?


Why do we need that?

Basically C# has to different types of assembly version information:
AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion

AssemblyVersion and AssemblyFileVersion are for end releases and accept only major, minor and patch only as number, for example: 1.2.3, BUT NOT 1.2.3-prelrelease.1

AssemblyInformationalVersion on the other hand accepts major, minor and patch with discriptive information, for example: 1.2.3, AND 1.2.3-prelrelease.1

So we want to change AssemblyVersion and AssemblyFileVersion only when master is the target branch.

We use yaml.

Not sure if you have found a workaround. There is one in this comment, semantic-release/semantic-release#1204 (comment). I think this is outside the scope of this plugin.