https://github.com/scomans/increment-version-action
GitHub Action that increments version based on the current latest release
https://github.com/scomans/increment-version-action
Last synced: over 1 year ago
JSON representation
GitHub Action that increments version based on the current latest release
- Host: GitHub
- URL: https://github.com/scomans/increment-version-action
- Owner: scomans
- License: mit
- Created: 2023-02-05T15:24:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-25T10:20:45.000Z (about 2 years ago)
- Last Synced: 2025-01-18T03:08:02.195Z (over 1 year ago)
- Language: TypeScript
- Size: 1.45 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Increment version based on latest release action
This action gets the apps affected by the changes since the last successful build and sets them as outputs.
## Inputs
### `repo`
The report to check for releases (Defaults to environment variable: `GITHUB_REPOSITORY`).
Example: `scomans/increment-version-action`
### `tagPrefix`
The prefix that might be in front of the version. Example: `v`
### `releaseType`
**Required** The release type. Possible values: `MAJOR`, `MINOR`, `PATCH`
### `github_token`
**Required if repo is private** Your GitHub access token (see Usage below).
## Outputs
### `newVersion`
The version after the increment
### `currentVersion`
The version before the increment
## Example usage
```yaml
on:
workflow_dispatch:
inputs:
type:
description: 'Release type'
required: true
default: 'MINOR'
type: choice
options:
- MAJOR
- MINOR
- PATCH
jobs:
increment-version:
runs-on: ubuntu-latest
name: Get affected apps
outputs:
newVersion: ${{ steps.version_increment.outputs.newVersion }}
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- uses: scomans/increment-version-action@v1
id: version_increment
with:
branch: ${{ github.event.inputs.type }}
github_token: ${{ secrets.GITHUB_TOKEN }}
app-a:
runs-on: ubuntu-latest
name: build app a
needs: increment-version
steps:
- name: Update version in source
run: ${{ needs.increment-version.output.newVersion }}
```