https://github.com/discoverygarden/auto-semver
Action to generate versioning tags.
https://github.com/discoverygarden/auto-semver
github github-actions
Last synced: 4 months ago
JSON representation
Action to generate versioning tags.
- Host: GitHub
- URL: https://github.com/discoverygarden/auto-semver
- Owner: discoverygarden
- License: gpl-3.0
- Created: 2021-09-20T19:15:06.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2026-01-19T06:08:17.000Z (5 months ago)
- Last Synced: 2026-02-12T10:52:10.574Z (5 months ago)
- Topics: github, github-actions
- Language: Shell
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 8
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# auto-semver
A GitHub action for automatically semantic versioning a repository when a closing and merging in a pull request.
## Inputs
- **token:** Token to use to push to the repo. Pass in using `secrets.GITHUB_TOKEN`. (required)
- **prefix:** The prefix prepended to the version number. Default is `v`.
## Outputs
This action does not output any artifacts.
## Secrets
This action does not use any secrets.
## Usage
Learn more about GitHub Actions in general [here](https://docs.github.com/en/actions/quickstart).
To use this action in your repo, follow these steps:
1. Create a YAML file in the `.github/workflows/` directory of your repo.
2. Copy the following into the YAML file:
```yaml
name: Auto Semver
on:
pull_request:
types: closed
branches:
- main
jobs:
update:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Run Auto Semver
uses: discoverygarden/auto-semver@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
```
This will run the automatic semantic versioning on closed pull requests to the main branch of a repository. Before it runs the job, it'll also check to see if the pull request is `Merged`, if it was simply closed, it won't run the jobs, as we don't want to increment the version number on any closed pull requests except for ones that have been merged.