gh-action-bump-version icon indicating copy to clipboard operation
gh-action-bump-version copied to clipboard

How to get the new version output for the next step?

Open sebastiangug opened this issue 3 years ago • 4 comments

Currently have the following step:

      - name: "Automated Version Bump"
        uses: "phips28/gh-action-bump-version@master"
        id: version-bump
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          target-branch: "main"
          commit-message: "CI: bumps version to {{version}} [skip ci]"
          major-wording: "MAJOR"
          patch-wording: "patch,fix"
          default: minor

but steps.version_bump.outputs.newVersion and steps.version_bump.outputs.version are both undefined

sebastiangug avatar Jul 22 '22 15:07 sebastiangug

@sebastiangug looks like there's a newTag field? https://github.com/phips28/gh-action-bump-version/blob/master/action.yml#L70

IPWright83 avatar Jul 23 '22 20:07 IPWright83

Actually newTag always seems to be blank :(

IPWright83 avatar Jul 23 '22 20:07 IPWright83

I don't know why this isn't work after doing some digging. Looking at other actions they're using a different approach e.g. https://github.com/marvinpinto/actions/blob/05a5fd79e119b74bf8fa909a7ecb52bef9aaf1da/packages/automatic-releases/src/main.ts#L319 by using import * as core from '@actions/core';

IPWright83 avatar Jul 23 '22 21:07 IPWright83

change the id from version-bump to version_bump, then use steps.version_bump.outputs.newTag

Pho3niX90 avatar Aug 28 '22 16:08 Pho3niX90