Skip to content

rebase-pr: use jq magic for encoding URI #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions github-actions/rebase-pr/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TARGET_REPOSITORY=$(jq -r ".pull_request.base.repo.full_name" "$GITHUB_EVENT_PAT
TARGET_BRANCH=$(jq -r ".pull_request.base.ref" "$GITHUB_EVENT_PATH")
REPO_FULL_NAME=$(jq -r ".repository.full_name" "$GITHUB_EVENT_PATH")
PR_NUMBER=$(jq -r ".pull_request.number" "$GITHUB_EVENT_PATH")
REBASE_PR_LABEL=$(jq -r ".label.name" "$GITHUB_EVENT_PATH")
REBASE_PR_LABEL=$(jq -r ".label.name | @uri" "$GITHUB_EVENT_PATH")

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

exit $SUCCESS_EXIT_CODE