Skip to content

Issues with cycjimmy/semantic-release-action in main workflow (Rev 2) #715

@MikeMcC399

Description

@MikeMcC399

This is a re-submission of #672 removing the issue caused by cycjimmy/semantic-release-action v2. PR #712 has bumped cycjimmy/semantic-release-action to v3 which has resolved the previous deprecation warnings.

Workflow location

.github/workflows/main.yml

Issue 1 - parameter branch

The action cycjimmy/semantic-release-action's README: Inputs lists the parameters branches and branch as follows:

Input Parameter Required Description
branches false The branches on which releases should happen.[Details]
Support for semantic-release above v16.
branch false The branch on which releases should happen.[Details]
Only support for semantic-release older than v16.

Logs show "ℹ Running semantic-release version 19.0.5" which is newer that semantic-release v16 (see above), so the input parameter branch is not correct.

Issue 2 - failure in fork

When main.yml executes on a GitHub fork, it fails with an Annotations error:

"SemanticReleaseError: Cannot push to the Git repository."

In detail "The command "git push --dry-run --no-verify https://x-access-token:[secure]@github.com/cypress-io/github-action.git HEAD:master" fails with the error message remote: Permission to cypress-io/github-action.git denied to github-actions[bot]."

Instead of failing it should skip trying to run on a fork.

Suggestions

Change cycjimmy/semantic-release-action parameter to branches

Change branch: master to branches: master.

Although the parameter branch: currently works, changing it to branches: makes it conformant to the documentation.

Prevent cycjimmy/semantic-release-action running in fork

if: github.ref == 'refs/heads/master'

Add if condition to ensure it only tries to release when it is running on cypress-io/github-action. See Example: Only run job for specific repository.

For instance, consider adding:

if: github.repository == 'cypress-io/github-action'

Workaround

Disable the workflow .github/workflows/main.yml in the fork to prevent failures. See GitHub help: Disabling and enabling a workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions