Skip to content

Commit

Permalink
fixes the silent failure
Browse files Browse the repository at this point in the history
  • Loading branch information
bdougie committed Sep 20, 2020
1 parent 74d728d commit 80600b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/sh

BODY="$(jq '.comment.body' $GITHUB_EVENT_PATH)"
ISSUE_NUMBER="$(jq '.issue.number' $GITHUB_EVENT_PATH)"
ISSUE_NUMBER="$(jq '.issue.number' $GITHUB_EVENT_PATH | tr -d \")"

This comment has been minimized.

Copy link
@bdougie

bdougie Sep 20, 2020

Author Owner

This was the fix. The ISSUE_NUMBER was not a string until I removed the "

LOGIN="$(jq '.comment.user.login' $GITHUB_EVENT_PATH | tr -d \")"
REPO="$(jq '.repository.full_name' $GITHUB_EVENT_PATH | tr -d \")"

if [[ "$BODY" == *".take"* ]]; then
jq . $GITHUB_EVENT_PATH

if [[ $BODY == *".take"* ]]; then
echo "Assigning issue $ISSUE_NUMBER to $LOGIN"
echo "Using the link: https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees"
curl -H "Authorization: token $GITHUB_TOKEN" -d '{"assignees":["'"$LOGIN"'"]}' https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees
fi

0 comments on commit 80600b0

Please sign in to comment.