Skip to content

Commit 6c9a525

Browse files
authored
ci(cd): fix json contents
1 parent 60d44b4 commit 6c9a525

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

.github/workflows/check-version.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,21 @@ jobs:
4444
id: extract_version
4545
run: |
4646
VERSION=$(grep -oP 'The next release version is \K[0-9]+\.[0-9]+\.[0-9]+' release.log || echo "unknown")
47+
echo "VERSION=$VERSION" >> $GITHUB_ENV
4748
echo "Extracted version: $VERSION"
48-
cat <<EOF > $JSON_FILE
49-
{
50-
"schemaVersion": 1,
51-
"label": "next version",
52-
"message": "${VERSION}",
53-
"color": "blue"
54-
}
55-
EOF
49+
50+
- name: Create JSON file
51+
run: |
52+
cat <<EOF > $JSON_FILE
53+
{
54+
"schemaVersion": 1,
55+
"label": "next version",
56+
"message": "${VERSION}",
57+
"color": "blue"
58+
}
59+
EOF
60+
env:
61+
VERSION: ${{ env.VERSION }}
5662

5763
- name: Update Gist with badge
5864
env:
@@ -67,4 +73,4 @@ jobs:
6773
-H "Authorization: Bearer ${GIST_TOKEN}" \
6874
-H "X-GitHub-Api-Version: 2022-11-28" \
6975
https://api.github.com/gists/${GIST_ID} \
70-
-d '{"files":{$JSON_FILE:{"content":$JSON_CONTENT}}}'
76+
-d '{"files":{"$JSON_FILE":{"content":"$JSON_CONTENT"}}}'

0 commit comments

Comments
 (0)