diff --git a/README.md b/README.md index 9f6bc4f..9475ac8 100644 --- a/README.md +++ b/README.md @@ -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 @@ -75,6 +78,14 @@ jobs: +## 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 diff --git a/action.yml b/action.yml index 075f480..7d2ebfa 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/entrypoint.sh b/entrypoint.sh index 3ecad02..4c04b28 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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}