1111 value : ${{ jobs.get_version.outputs.tag }}
1212 newVersion :
1313 description : ' Was a new version generated?'
14- value : ${{ jobs.get_version.outputs.newVersion }}
14+ value : ${{ jobs.get_version.outputs.newVersion }}
1515 type :
1616 description : ' The type of version bump'
1717 value : ${{ jobs.get_version.outputs.type }}
@@ -31,13 +31,35 @@ jobs:
3131 channel : ${{ steps.get_version.outputs.channel }}
3232 newVersion : ${{ steps.get_version.outputs.newVersion }}
3333 steps :
34- - uses : actions/checkout@v3
35- - uses : actions/setup-node@v3 # v3
34+ - uses : actions/checkout@v4
35+ - uses : actions/setup-node@v4 # v4
3636 with :
3737 cache : npm
3838 node-version : lts/*
3939 registry-url : https://npm.pkg.github.com
40- scope : ' @pepperdash-products'
40+ scope : " @pepperdash"
41+ - name : Get branch name
42+ id : get_branch
43+ run : |
44+ branch=${GITHUB_REF#refs/heads/}
45+ echo "branch=$branch" >> $GITHUB_OUTPUT
46+ echo "prerelease=${branch//\//-}" >> $GITHUB_OUTPUT
47+ env :
48+ GITHUB_REF : ${{ github.ref }}
49+ - name : Replace branch name in .releaserc.json
50+ if : steps.get_branch.outputs.branch != 'main'
51+ uses : jacobtomlinson/gha-find-replace@v3
52+ with :
53+ find : ' replace-me-feature-branch'
54+ replace : ' ${{ steps.get_branch.outputs.branch }}'
55+ include : ' .releaserc.json'
56+ - name : Replace prerelease name in .releaserc.json
57+ if : steps.get_branch.outputs.branch != 'main'
58+ uses : jacobtomlinson/gha-find-replace@v3
59+ with :
60+ find : ' replace-me-prerelease'
61+ replace : ' ${{ steps.get_branch.outputs.prerelease }}'
62+ include : ' .releaserc.json'
4163 - name : Get version number
4264 id : get_version
4365 run : |
@@ -50,12 +72,11 @@ jobs:
5072 -- semantic-release
5173 echo "hash=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
5274 env :
53- NODE_AUTH_TOKEN : ${{ secrets.NPM_REGISTRY_TOKEN }}
75+ NODE_AUTH_TOKEN : ${{ secrets.NPM_REGISTRY_TOKEN }}
5476 NPM_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5677 - name : Print summary if no new version
5778 if : steps.get_version.outputs.newVersion != 'true'
58- run : |
79+ run : |
5980 branch=${GITHUB_REF#refs/heads/}
6081 echo "# UI V2 Summary" >> $GITHUB_STEP_SUMMARY
6182 echo "No new version generated" >> $GITHUB_STEP_SUMMARY
@@ -72,10 +93,10 @@ jobs:
7293 if : steps.get_version.outputs.newVersion == 'true'
7394 run : |
7495 echo "# UI V2 Summary" >> $GITHUB_STEP_SUMMARY
75-
96+
7697 echo "Version: ${{ steps.get_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
7798 echo "Tag: ${{ steps.get_version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
7899 echo "New Version: ${{ steps.get_version.outputs.newVersion }}" >> $GITHUB_STEP_SUMMARY
79100 echo "Channel: ${{ steps.get_version.outputs.channel }}" >> $GITHUB_STEP_SUMMARY
80101 echo "Type: ${{ steps.get_version.outputs.type }}" >> $GITHUB_STEP_SUMMARY
81- echo "Short SHA: ${{ steps.get_version.outputs.hash }}" >> $GITHUB_STEP_SUMMARY
102+ echo "Short SHA: ${{ steps.get_version.outputs.hash }}" >> $GITHUB_STEP_SUMMARY
0 commit comments