Skip to content

Commit 13b25d3

Browse files
rebase-pr: use jq magic for encoding URI (#60)
1 parent b715960 commit 13b25d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

github-actions/rebase-pr/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ TARGET_REPOSITORY=$(jq -r ".pull_request.base.repo.full_name" "$GITHUB_EVENT_PAT
1515
TARGET_BRANCH=$(jq -r ".pull_request.base.ref" "$GITHUB_EVENT_PATH")
1616
REPO_FULL_NAME=$(jq -r ".repository.full_name" "$GITHUB_EVENT_PATH")
1717
PR_NUMBER=$(jq -r ".pull_request.number" "$GITHUB_EVENT_PATH")
18-
REBASE_PR_LABEL=$(jq -r ".label.name" "$GITHUB_EVENT_PATH")
18+
REBASE_PR_LABEL=$(jq -r ".label.name | @uri" "$GITHUB_EVENT_PATH")
1919

2020
# Change to the github workspace and initialize the repo if needed.
2121
cd "$GITHUB_WORKSPACE"
@@ -46,6 +46,6 @@ git push --force-with-lease pr "$PR_BRANCH"
4646
# Remove the label that was used to trigger the action via the Github API.
4747
curl --request DELETE \
4848
-H "Authorization: token $TOKEN" \
49-
"$(echo https://api.github.com/repos/$REPO_FULL_NAME/issues/$PR_NUMBER/labels/$REBASE_PR_LABEL | sed 's/ /%20/g')"
49+
https://api.github.com/repos/$REPO_FULL_NAME/issues/$PR_NUMBER/labels/$REBASE_PR_LABEL
5050

5151
exit $SUCCESS_EXIT_CODE

0 commit comments

Comments
 (0)