Closed kvernon closed 1 year ago
I figured this out... I'm posting here in case someone else is curious too.
A little background on this. We're assigning some values up front. Also, this job would fail if this step failed, so continue-on-error: true
is important here. From there, you can check if steps.semver-tag.outputs.semver_tag
has a value
- id: semver-tag
uses: wakatime/semver-action@v1.5.1
continue-on-error: true
with:
prefix: "${{ inputs.versionTagPrefix }}"
prerelease_id: "${{ env.BRANCH_NAME }}"
main_branch_name: "${{ inputs.mainBranchName }}"
develop_branch_name: "${{ inputs.developBranchName }}"
debug: "${{ inputs. Debug }}"
- name: Default the Version for Feature Branch
if: ${{ steps.semver-tag.outputs.semver_tag == '' && inputs.isFeatureBranch}}
run: echo "TAG=0.0.0-${{ env.BRANCH_NAME }}-${{ github.run_number }}" >> $GITHUB_ENV
- name: Default the Version for Release
if: ${{ steps.semver-tag.outputs.semver_tag == '' && !inputs.isFeatureBranch }}
run: echo "TAG=0.0.${{ github.run_number }}" >> $GITHUB_ENV
- name: "tag found is success"
if: ${{ steps.semver-tag.outputs.semver_tag != '' }}
run: echo "TAG=${{ steps.semver-tag.outputs.semver_tag }}" >> $GITHUB_ENV
Hi again y'all!
So I'm working with this github action, but I can't figure out the right way to go with new repos using this tool.
Basically, I've started coding in a feature branch, and there is no production code (master/main is empty). I'm build up my action using this strategy. I think the issue with this tool is that there are no existing tags, so it doesn't know how to proceed.
How would you all go forward in brand new repos? It seems pre meditative to tag a new repo with
v0.0.0
. Is there a default I can set up if there are no tags when this action looks?