Skip to content

Commit

Permalink
Merge pull request #3 from debugger24/feature/fix-major-release-version
Browse files Browse the repository at this point in the history
Add check for tagname in major release
  • Loading branch information
debugger24 authored Aug 23, 2022
2 parents 522c8a4 + 00e4097 commit 8573068
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/scripts/source-tag-sha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ sha=$(
https://api.github.com/repos/${repo}/git/ref/tags/${tag_name} |
jq '.object.sha' --raw-output
)

if [[ $sha == 'null' ]]; then
echo "Error: Tag name ${tag_name} not found"
exit 1
fi

echo "SHA for ${tag_name}: ${sha}"
echo "::set-output name=sha::$sha"
2 changes: 1 addition & 1 deletion .github/workflows/major-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
.github/scripts/source-tag-sha.sh \
${{ github.repository }} \
${{ steps.get-major-version.outputs.major_version }} \
${TAG_NAME} \
${{ secrets.GITHUB_TOKEN }}
- name: Create Major Release
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-action-template",
"version": "1.0.0",
"version": "1.0.1",
"description": "Github Action Template",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 8573068

Please sign in to comment.