Skip to content

Commit

Permalink
fix: handle PR refs
Browse files Browse the repository at this point in the history
  • Loading branch information
rokroskar committed Feb 4, 2020
1 parent 110a9a2 commit ac2f13d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@ then
exit 1
fi

if [ -z "$GITHUB_HEAD_REF" ]
then
# we have a push event
BRANCH=${GITHUB_REF:11}
else
BRANCH=${GITHUB_HEAD_REF}
fi

# jq queries

jq_workflow_id=".workflows |.[]| select(.name==\"${GITHUB_WORKFLOW}\") .id"
jq_run_id=".workflow_runs | .[] | select(.head_branch==\"${GITHUB_REF:11}\" and .status==\"in_progress\") | .id"
jq_run_id=".workflow_runs | .[] | select(.head_branch==\"${BRANCH}\" and .status==\"in_progress\") | .id"

# get the github workflow ID

Expand Down

0 comments on commit ac2f13d

Please sign in to comment.