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

Referring to the wrong branch. #119

Open ytetsuro opened 2 years ago

ytetsuro commented 2 years ago

Describe the bug

I ran semantic-release on the master branch, but the release fail. The reason is the following.

[5:34:45 AM] [semantic-release] › ℹ  Running semantic-release version 19.0.3
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/changelog"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/git"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/changelog"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/git"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
[5:[34](https://github.com/ytetsuro/sabik/runs/7832677258?check_suite_focus=true#step:6:35):46 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[5:34:46 AM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[5:34:48 AM] [semantic-release] › ℹ  This test run was triggered on the branch develop, while semantic-release is configured to only publish from master, therefore a new version won’t be published.

Workflow

workflow config

Expected behavior

It is correctly recognized as a master branch and deployed.

Additional context

This repository has a default branch is develop. I checked the name of the branch I was checking out just before deploying and it was master.

JoseLion commented 2 years ago

We experienced the same issue. Not sure if related, but the our release action was triggering on a workflow_run instead of a push:

on:
  workflow_run:
    workflows: [Build]
    branches: [release]
    types:
      - completed