Skip to content

Commit 45feb5a

Browse files
committed
fix(CI); autolabel correct json fields (leanprover-community#25661)
Apply the correct quotations to the json fields.
1 parent d644516 commit 45feb5a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/add_label_from_diff.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ jobs:
4141
printf 'Applying label %s\n' "${label}"
4242
# we use curl rather than octokit/request-action so that the job won't fail
4343
# (and send an annoying email) if the labels don't exist
44+
url="https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels"
45+
printf 'url: %s\n' "${url}"
46+
jsonLabel="$(printf '{"labels":["%s"]}' "${label}")"
47+
printf 'jsonLabel: %s\n' "${jsonLabel}"
4448
curl --request POST \
4549
--header 'Accept: application/vnd.github+json' \
4650
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
4751
--header 'X-GitHub-Api-Version: 2022-11-28' \
48-
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
49-
--data "{'labels':[${label}]}"
52+
--url "${url}" \
53+
--data "${jsonLabel}"
5054
else
5155
echo "There is no single label that we could apply, so we are not applying any label."
5256
fi

0 commit comments

Comments
 (0)