diff --git a/.github/workflows/tag-and-release.yml b/.github/workflows/tag-and-release.yml index 2e64e1a..9f2d405 100644 --- a/.github/workflows/tag-and-release.yml +++ b/.github/workflows/tag-and-release.yml @@ -29,15 +29,15 @@ jobs: DEFAULT_BUMP: minor GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} run: | - echo "Token length: ${#GITHUB_TOKEN}" - ./bump_version.sh + echo "Token length: ${#GITHUB_TOKEN}" + ./bump_version.sh - name: Create Release if: success() uses: actions/create-release@v1 with: - tag_name: ${{ steps.tag.outputs.new_tag }} - release_name: Release ${{ steps.tag.outputs.new_tag }} + tag_name: v${{ steps.bump_version.outputs.NEW_VERSION }} + release_name: Release v${{ steps.bump_version.outputs.NEW_VERSION }} body: | See [CHANGELOG](https://github.com/tawanda-kembo/code-collator/blob/main/CHANGELOG.md) for details. draft: false diff --git a/bump_version.sh b/bump_version.sh index c38191e..0fbafb6 100755 --- a/bump_version.sh +++ b/bump_version.sh @@ -1,11 +1,6 @@ #!/bin/bash set -e -echo "Token length: ${#GITHUB_TOKEN}" -echo "Remote URL before: $(git remote get-url origin)" -git remote set-url origin "https://${GITHUB_TOKEN}@github.com/tawanda-kembo/code-collator.git" -echo "Remote URL after: $(git remote get-url origin)" - # Default bump type DEFAULT_BUMP=${DEFAULT_BUMP:-minor} @@ -51,4 +46,7 @@ git remote set-url origin "https://${GITHUB_TOKEN}@github.com/tawanda-kembo/code git tag "v$NEW_VERSION" # Push the tag using the GITHUB_TOKEN -git push origin "v$NEW_VERSION" \ No newline at end of file +git push origin "v$NEW_VERSION" + +# Set the output variable for the new version +echo "::set-output name=NEW_VERSION::v$NEW_VERSION" \ No newline at end of file