Skip to content

Commit

Permalink
docs: Add usage documentation (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjliggett committed Oct 12, 2021
1 parent 620360b commit 960a143
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,55 @@

jjversion-action is a composite GitHub action that uses the Go package [jjliggett/jjversion](https://github.com/jjliggett/jjversion) to calculate a version for a git repository and parse version attributes as GitHub Action outputs.

## Usage

For this action to work properly, you must create a versioning.yaml file in your repository and checkout your repository in your workflow with ```fetch-depth: 0``` to fetch all history for all tags and branches. Configuration information for the versioning.yaml file can be found in the <https://github.com/jjliggett/jjversion> repository.

### Inputs

The action accepts the following input:

```yaml
skip-go-installation:
description: "If set to true, then the action uses pre-installed Go"
default: "false"
required: false
```
### Outputs
The action creates the following outputs:
- major
- minor
- patch
- majorMinorPatch
- sha
- shortSha
### Example Usage
An example usage can be seen below:
```yaml
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get version
id: jjversion
uses: jjliggett/jjversion-action@620360b53e852c7316cbf9e233ea2a5de4f39f40
- name: Display jjversion outputs
run: |
echo "Major: ${{ steps.jjversion.outputs.major }}"
echo "Minor: ${{ steps.jjversion.outputs.minor }}"
echo "Patch: ${{ steps.jjversion.outputs.patch }}"
echo "MajorMinorPatch: ${{ steps.jjversion.outputs.majorMinorPatch }}"
echo "Sha: ${{ steps.jjversion.outputs.sha }}"
echo "ShortSha: ${{ steps.jjversion.outputs.shortSha }}"
```
## Licensing
Licensing can be found at: [LICENSE.md](LICENSE.md).
Expand Down

0 comments on commit 960a143

Please sign in to comment.