mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 22:34:01 -05:00
Fixed looking up users with special username characters
- users like `renovate[bot]` have brackets in the username - this breaks the command and it exits with `exit code 3.` - to fix this, we can encode the username before passing it in
This commit is contained in:
parent
b4f2e03ae2
commit
d86f94db2d
1 changed files with 2 additions and 1 deletions
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
@ -66,8 +66,9 @@ jobs:
|
|||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
echo "Looking up: ${{ github.event.pull_request.user.login }}"
|
||||
ENCODED_USERNAME=$(printf '%s' '${{ github.event.pull_request.user.login }}' | jq -sRr @uri)
|
||||
|
||||
LOOKUP_USER=$(curl --write-out "%{http_code}" --silent --output /dev/null --location 'https://api.github.com/orgs/tryghost/members/${{ github.event.pull_request.user.login }}' --header 'Authorization: Bearer ${{ secrets.CANARY_DOCKER_BUILD }}')
|
||||
LOOKUP_USER=$(curl --write-out "%{http_code}" --silent --output /dev/null --location "https://api.github.com/orgs/tryghost/members/$ENCODED_USERNAME" --header "Authorization: Bearer ${{ secrets.CANARY_DOCKER_BUILD }}")
|
||||
|
||||
if [ "$LOOKUP_USER" == "204" ]; then
|
||||
echo "User is in the org"
|
||||
|
|
Loading…
Reference in a new issue