https://github.com/dolittle/read-version-from-file-action
https://github.com/dolittle/read-version-from-file-action
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dolittle/read-version-from-file-action
- Owner: dolittle
- License: mit
- Created: 2020-10-23T07:57:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-11T15:03:17.000Z (almost 2 years ago)
- Last Synced: 2025-01-18T00:33:51.538Z (4 months ago)
- Language: JavaScript
- Size: 53.7 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Action - Read Version From File
This GitHub action reads the version information from a given file with a well known JSON structure.
If the file does not exist, it will return the default version of **1.0.0**.
## Pre requisites
node <= 12
yarn
git## Usage
Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow) is available below.
For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file)
### Inputs
- `path`: The path to the file within the repository.
### Outputs
- `current-version`: The current version read from the file.
### Example Workflow
```yaml
on:
push:
branches:
- '**'
pull_request:
types: [closed]name: GitHub action workflow name
jobs:
context:
name: Job name
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get current version
uses: dolittle/read-version-from-file-action@v2
with:
path: ./Source/version.json
```## Contributing
We're always open for contributions and bug fixes!