Skip to content

Commit 681e512

Browse files
authored
Refactor JSON creation for GitHub Gist update
1 parent db0d338 commit 681e512

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

.github/workflows/python-loc.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,8 @@ jobs:
2525
GIST_ID: ${{ secrets.LOC_GIST_ID }}
2626
LOC: ${{ steps.loc.outputs.loc }}
2727
run: |
28-
json=$(cat <<EOF
29-
{
30-
"schemaVersion": 1,
31-
"label": "python loc",
32-
"message": "${LOC}",
33-
"color": "blue"
34-
}
35-
EOF
36-
)
37-
3828
curl -X PATCH "https://api.github.com/gists/${GIST_ID}" \
3929
-H "Authorization: token ${GIST_TOKEN}" \
4030
-H "Accept: application/vnd.github+json" \
41-
-d "{\"files\": {\"python-loc.json\": {\"content\": ${json@Q}}}}"
31+
-d "{\"files\": {\"python-loc.json\": {\"content\": \"{\\\"schemaVersion\\\":1,\\\"label\\\":\\\"python loc\\\",\\\"message\\\":\\\"${LOC}\\\",\\\"color\\\":\\\"blue\\\"}\"}}}"
32+

0 commit comments

Comments
 (0)