diff --git a/.github/scripts/source-tag-sha.sh b/.github/scripts/source-tag-sha.sh index 4deeb25..6b9119c 100755 --- a/.github/scripts/source-tag-sha.sh +++ b/.github/scripts/source-tag-sha.sh @@ -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" diff --git a/.github/workflows/major-release.yaml b/.github/workflows/major-release.yaml index 9466604..73d56ed 100644 --- a/.github/workflows/major-release.yaml +++ b/.github/workflows/major-release.yaml @@ -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 diff --git a/package.json b/package.json index 5a1fe40..9a85840 100644 --- a/package.json +++ b/package.json @@ -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": {