Skip to content

Commit 6b44b59

Browse files
committed
Pass data through variables
1 parent 7abed1c commit 6b44b59

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ jobs:
3535
run: npm ci
3636

3737
- name: Push version bump and tag
38+
id: version
3839
run: |
3940
git config user.name "github-actions"
4041
git config user.email "[email protected]"
4142
npm version ${{ github.event.inputs.bump }} --no-git-tag-version
4243
version=$(jq -r .version package.json)
44+
echo "version=$version" >> $GITHUB_OUTPUT
4345
git add package.json package-lock.json
4446
git commit -m "Bump version to $version"
4547
git tag $version
@@ -79,9 +81,9 @@ jobs:
7981

8082
- name: Create GitHub release
8183
run: |
82-
git fetch --tags
83-
tag=$(git describe --tags --abbrev=0)
84-
gh release create "$tag" --title "$tag" --notes "${{ env.RELEASE_NOTES }}"
84+
gh release create "${{ steps.version.outputs.version }}" \
85+
--title "${{ steps.version.outputs.version }}" \
86+
--notes "${{ env.RELEASE_NOTES }}"
8587
env:
8688
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8789

@@ -97,8 +99,8 @@ jobs:
9799
- name: Extract release data
98100
id: release_data
99101
run: |
100-
echo "title=${{ github.ref_name }}" >> $GITHUB_OUTPUT
101-
body=$(gh release view ${{ github.ref_name }} --json body --jq .body)
102+
echo "title=${{ needs.release.outputs.version }}" >> $GITHUB_OUTPUT
103+
body=$(gh release view ${{ needs.release.outputs.version }} --json body --jq .body)
102104
{
103105
echo "body<<EOF"
104106
echo "$body"

0 commit comments

Comments
 (0)