https://github.com/panates/gh-version-info
Action for retrieving version info
https://github.com/panates/gh-version-info
Last synced: 9 months ago
JSON representation
Action for retrieving version info
- Host: GitHub
- URL: https://github.com/panates/gh-version-info
- Owner: panates
- License: mit
- Created: 2025-02-11T08:45:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-17T14:24:42.000Z (over 1 year ago)
- Last Synced: 2025-08-20T06:05:08.418Z (11 months ago)
- Language: TypeScript
- Size: 1.14 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Version Info
Action for retrieving version info
[GitHub Action](https://github.com/features/actions) that extracts version info
from commit tags and github releases.
## Usage
```yaml
- uses: panates/gh-version-info@v1
with:
# Personal access token used to fetch a list of changed files from GitHub REST API.
# GitHub token from workflow context is used as default value.
# Default: ${{ github.token }}
token: ''
```
## Outputs
- *lastVersion*: Last version tag name
- *lastSha*: Last version sha
- *prevVersion*: Previous version tag name
- *prevSha*: Previous version sha
- *releasedVersion*: Last released version tag name
- *releasedSha*: Last released version sha
- *versions*: Array of version info objects
- *releasedVersions*: Array of released version info objects
- *last*: Info object for last version found
- *needRelease*: `true` if last sha differs from released sha, `false` otherwise
- *previous*: Info object for previous version found
- *released*: Info object for last released version found
## Examples
```yaml
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: panates/gh-version-info@v2
id: version_info
# run only if 'backend' files were changed
- name: create release
if: ${{ steps.filter.outputs.needRelease == 'true' }}
run: ...
# run only if latest version starts with v1
- name: v1 tests
if: ${{ startsWith(steps.filter.outputs.lastVersion, 'v1') }}
run: ...
# run only if released version starts with v1
- name: v1 tests
if: ${{ startsWith(steps.filter.outputs.releasedVersion, 'v1') }}
run: ...
```
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)