You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Semver diff
v2.0.0
Get the difference between two semantic versions using semver-tool
name: Get semver diff
on:
release:
types:
- created
push:
tags:
- v*
jobs:
test:
runs-on: ubuntu-latest
name: semver-diff
steps:
- uses: actions/checkout@v2
- name: Run semver-diff
id: semver-diff
uses: tj-actions/semver-diff@v1.2.1
- name: Show release type
run: |
echo "Release type: ${{ steps.semver-diff.outputs.release_type }}"
# Outputs: Release type: major || minor || patch || prerelease || build
Using bump2version
name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run semver-diff
id: semver-diff
uses: tj-actions/semver-diff@v1.2.1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6.x'
- name: Install dependencies
...
- name: Setup git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: bumpversion
run: |
bump2version PART="${{ steps.semver-diff.outputs.release_type }}"
git switch -c main
- name: Build and publish to PyPi
...
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
base: "main"
...
Input | type | required | default | description |
---|---|---|---|---|
token | string |
true |
${{ github.token }} |
GITHUB_TOKEN or a repo scoped Personal Access Token |
initial_release_type | string |
true |
patch |
Initial release type returned when there are no existing tags. |
Output | type | description |
---|---|---|
release_type | string |
The difference between two versions by release type (major, minor, patch, prerelease, build) |
- Free software: MIT license
If you feel generous and want to show some extra appreciation:
This package was created with Cookiecutter using cookiecutter-action
Report bugs at https://github.com/tj-actions/semver-diff/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your workflow that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.