File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 required : true
1313 default : latest
1414 type : string
15+ release_notes :
16+ description : GitHub release notes (markdown). The release is created only for the latest dist-tag
17+ required : false
18+ type : string
1519
1620permissions :
1721 contents : read
@@ -28,10 +32,12 @@ jobs:
2832 steps :
2933 - name : Validate inputs
3034 run : |
35+ num='(0|[1-9][0-9]*)'
36+ id='(0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)'
3137 if [ "$NPM_TAG" = latest ]; then
32- pattern='^[0-9]+\.[0-9]+\.[0-9]+$'
38+ pattern="^$num\\.$num\\.$num\$"
3339 else
34- pattern='^[0-9]+\.[0-9]+\.[0-9]+-[0-9A-Za-z.-]+$'
40+ pattern="^$num\\.$num\\.$num-$id(\\.$id)*\$"
3541 fi
3642 if ! [[ "$VERSION" =~ $pattern ]]; then
3743 echo "::error::version '$VERSION' does not match $pattern for dist-tag '$NPM_TAG'"
6874 branch="release-$(date +%s)"
6975 git push --follow-tags origin "HEAD:refs/heads/$branch"
7076 echo "Open the version bump PR: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/$GITHUB_REF_NAME...$branch?expand=1" | tee -a "$GITHUB_STEP_SUMMARY"
77+
78+ - name : Create GitHub release
79+ if : inputs.npm_tag == 'latest' && inputs.release_notes != ''
80+ env :
81+ GH_TOKEN : ${{ github.token }}
82+ RELEASE_NOTES : ${{ inputs.release_notes }}
83+ run : gh release create "v$VERSION" --verify-tag --title "Public Beta v$VERSION" --notes "$RELEASE_NOTES"
You can’t perform that action at this time.
0 commit comments