Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI = false & dryrun = true does not result in prelease build #170

Open
greenkiwi opened this issue Aug 11, 2023 · 2 comments
Open

CI = false & dryrun = true does not result in prelease build #170

greenkiwi opened this issue Aug 11, 2023 · 2 comments

Comments

@greenkiwi
Copy link

Describe the bug
We would like to generate next release version in pull request.

Workflow
Prerelease action

      - name: Release check
        id: release-check
        uses: cycjimmy/semantic-release-action@v3
        with:
          dry_run: true
          ci: false
        env:
          GITHUB_TOKEN: ${{ secrets.PAT_GITHUB_TOKEN }}
          DEBUG: "semantic-release:*"

Action output:

Run cycjimmy/semantic-release-action@v3
  with:
    dry_run: true
    ci: false
  env:
    SDKMAN_DIR: /home/runners/.sdkman
    JAVA_HOME: /home/runners/.sdkman/candidates/java/current
    NODENV_ROOT: /home/runners/.nodenv
    GITHUB_TOKEN: ***
    DEBUG: semantic-release:*

[4:52:08 PM] [semantic-release] › ℹ  Running semantic-release version 19.0.5
2023-08-04T16:52:08.375Z semantic-release:config load config from: /opt/actions-runner/_work/dunlop/dunlop/.releaserc.json
2023-08-04T16:52:08.378Z semantic-release:config options values: {
  branches: [
    'master',
    '+([0-9])?(.{+([0-9]),x}).x',
    {
      name: 'refs/pull/**',
      channel: 'next',
      prerelease: "pr-${(/^[a-zA-Z]+-[0-9]+/.exec(name.substr(10)) || [name.replace(/[_/.]/g, '-')])[0]}-${Date.now()}"
    }
  ],
  repositoryUrl: 'https://github.com/t/d.git',
  tagFormat: 'v${version}',
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    '@semantic-release/github'
  ],
  dryRun: true,
  ci: false,
  noCi: true
}

Error message

[4:52:21 PM] [semantic-release] › ℹ  This test run was triggered on the branch refs/pull/32277/merge, while semantic-release is configured to only publish from master, therefore a new version won’t be published.

Expected behavior

That with CI set to false and dry_run set to true, we should get a "next release" version.

@davidspek
Copy link

dry_run will disable it from creating anything. I think if you remove dry_run it will create a release from a PR.

@adrianschmidt
Copy link

dry_run will disable it from creating anything.

Correct.

I think if you remove dry_run it will create a release from a PR.

Not correct. The error stems from the semantic-release config only allowing releases from master. Regardless of whether you are creating a pre-release or not, you can only release from a configured release branch. The way to create pre-releases is not to release them from the PR branch, but to merge them to a configured pre-release branch. See the semantic-release docs on publishing pre-releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants