Skip to content

Add version output and document REVISION env var #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ jobs:
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Create bump and changelog
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
```

## Variables
Expand All @@ -75,6 +78,14 @@ jobs:

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

## Outputs

| Name | Description |
| --------- | -------------------- |
| `version` | The new version |

Additionally, the new version is also availble as an environment variable under `REVISION`.

## Troubleshooting

### Other actions are not triggered when the tag is pushed
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ runs:
branding:
icon: 'git-commit'
color: 'purple'
outputs:
version:
description: 'New version'
inputs:
dry_run:
description: 'Run without creating commit, output to stdout'
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ fi
export REV=`cz version --project`
echo "REVISION=$REV" >> $GITHUB_ENV

echo "::set-output name=version::$REV"

echo "Pushing to branch..."
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"
git pull ${remote_repo} ${INPUT_BRANCH}
Expand Down