Skip to content
Closed
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
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ function find_workflow {
while [[ true ]]
do
counter=$(( $counter + 1 ))
workflow=$(curl -s "https://api.github.com/repos/${INPUT_OWNER}/${INPUT_REPO}/actions/runs?event=repository_dispatch" \
all_runs=$(curl -s "https://api.github.com/repos/${INPUT_OWNER}/${INPUT_REPO}/actions/runs" \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${INPUT_TOKEN}" | jq '.workflow_runs[0]')
-H "Authorization: Bearer ${INPUT_TOKEN}" | jq '.workflow_runs' )

# Github's API is eventually consistent when filtering by event. The API
# can return stale results when using the `event` filter on the API query.
# Filter runs locally to work around this.
dispatch_runs=$( echo $(echo $all_runs | jq 'map(select(.event=="repository_dispatch"))') )
workflow=$( echo $(echo $dispatch_runs | jq '.[0]') )

wtime=$( echo $(echo $workflow | jq '.created_at') | cut -c13-20 )
atime=$(date -u +%T)
Expand Down