Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patrickjahns/version-drafter-action
📈Github Action that determines the next semantic version based on pull request labels
https://github.com/patrickjahns/version-drafter-action
action github-action release-drafter semver version-drafter
Last synced: 2 months ago
JSON representation
📈Github Action that determines the next semantic version based on pull request labels
- Host: GitHub
- URL: https://github.com/patrickjahns/version-drafter-action
- Owner: patrickjahns
- License: isc
- Created: 2020-02-15T01:33:58.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-22T15:16:02.000Z (6 months ago)
- Last Synced: 2024-10-14T07:34:31.860Z (3 months ago)
- Topics: action, github-action, release-drafter, semver, version-drafter
- Language: JavaScript
- Size: 1.59 MB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# version-drafter-action
[![License: ISC](https://img.shields.io/github/license/patrickjahns/version-drafter-action)](LICENSE)
![Tests](https://github.com/patrickjahns/version-drafter-action/workflows/Tests/badge.svg?event=push)[GitHub Action](https://github.com/features/actions) designed as companion for [release-drafter](https://github.com/release-drafter/release-drafter) to determine the next [semantic version](https://semver.org/) based on the github labels of merged pull requests
## Usage
To use the action, create a yaml file ( i.e. `version.yml` ) in your `.github/workflows` folder
### Standalone example
```yaml
name: Update Releaseinfo
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- masterjobs:
update_version:
runs-on: ubuntu-latest
steps:
- name: calculate next version
id: version
uses: patrickjahns/version-drafter-action@v1
with:
# (Optional) specify config name to use, relative to .github/. Default: version-drafter.yml
# config-name: my-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: echo calculated version
run: |
echo "version: ${{ steps.version.outputs.next-version }}"
```
### With release-drafter```yaml
name: Update Releaseinfo
on:
push:
branches:
- masterjobs:
update_version:
runs-on: ubuntu-latest
steps:
- name: calculate next version
id: version
uses: patrickjahns/version-drafter-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: release-drafter/release-drafter@master
with:
version: ${{ format('v{0}', steps.version.outputs.next-version) }}
tag: ${{ format('v{0}', steps.version.outputs.next-version) }}
name: ${{ format('v{0}', steps.version.outputs.next-version) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```### Configuration
The action determines the next semantic version based on github labels. The mapping of the labels can be configured by
providing a yaml configuration (usually at `.github/version-drafter.yml`)```yaml
major-labels: ['semver:major']
minor-labels: ['semver:minor','enhancement']
patch-labels: ['semver:patch','bug']
```### Output
The action will output the calculated next semantic version as `next-version`, as well as the current tag as `current-version`