Skip to content

Commit 2f18c1d

Browse files
authored
Merge pull request #13 from crqra/feat/set-output
Add version output and document REVISION env var
2 parents ad6e6d8 + 8e97e70 commit 2f18c1d

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ jobs:
5353
with:
5454
fetch-depth: 0
5555
token: "${{ secrets.GITHUB_TOKEN }}"
56-
- name: Create bump and changelog
56+
- id: cz
57+
name: Create bump and changelog
5758
uses: commitizen-tools/commitizen-action@master
5859
with:
5960
github_token: ${{ secrets.GITHUB_TOKEN }}
61+
- name: Print Version
62+
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
6063
```
6164
6265
## Variables
@@ -75,6 +78,14 @@ jobs:
7578

7679
<!-- | `changelog` | Create changelog when bumping the version | true | -->
7780

81+
## Outputs
82+
83+
| Name | Description |
84+
| --------- | -------------------- |
85+
| `version` | The new version |
86+
87+
Additionally, the new version is also availble as an environment variable under `REVISION`.
88+
7889
## Troubleshooting
7990

8091
### Other actions are not triggered when the tag is pushed

action.yml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ runs:
66
branding:
77
icon: 'git-commit'
88
color: 'purple'
9+
outputs:
10+
version:
11+
description: 'New version'
912
inputs:
1013
dry_run:
1114
description: 'Run without creating commit, output to stdout'

entrypoint.sh

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ fi
4343
export REV=`cz version --project`
4444
echo "REVISION=$REV" >> $GITHUB_ENV
4545

46+
echo "::set-output name=version::$REV"
47+
4648
echo "Pushing to branch..."
4749
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"
4850
git pull ${remote_repo} ${INPUT_BRANCH}

0 commit comments

Comments
 (0)