Skip to main content
← Back to workflows

How to Run Merge Release Action in GitHub Workflows

mikeal/merge-release -
GitHub Action
4.3.0
475
Contributors
Contributor - mikealContributor - benwindingContributor - fadeenk
Categories
CICUBE ANALYTICS INSIGHTS
Engineering Velocity: 25% Team Time Lost to CI Issues
View Platform →
3.5h
Time Saved/Dev/Week
40%
Faster Releases
Click for next insight
Usage
- uses: mikeal/merge-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
DEPLOY_DIR: my/deploy/dir
SRC_PACKAGE_DIR: my/src/package

merge-release logo

merge-release

Automatically release all merges to master on npm.


How to Use Merge Release GitHub Action

Merge Release action does the following critical stuff to help publish automatically npm. Check the version number of the last published on npm and the commits between the git commit that triggered this action and the latest published. It then bumps the package's version according to the messages of these commits: a major version if a commit contains "BREAKING CHANGE," a minor for any commit containing "feat," or a patch for everything else. Finally, it publishes the npm package and pushes the tag for the new version up to Github.

Excellent features of this action include: automatic npm publishing based on commit messages, following the principles of semantic versioning, and making integration with GitHub Actions a lot easier.

How to Use

  1. Setup GitHub Secrets: Make sure you have GITHUB_TOKEN and NPM_AUTH_TOKEN as secrets in your GitHub repository.

  2. Create Workflow File: Create a Workflow file (example: publish.yml in the .github/workflows directory with the below configuration)

  3. Commit and Push: Commit and push the Workflow file to Repository. After that, your action will run on every push to the main or main branch, automatically publishing a new version to npm.

  4. Monitor Releases: In the Actions tab at the top of your GitHub repository, watch the workflow runs, affirming new versions are published as expected.

At this point, it should all be automated within your projects, so releasing a new version should be a smooth and error-free.