Tiny remove auto-triggering for list-active-pr-runs. (#16778)
This commit is contained in:
@@ -1,12 +1,10 @@
|
|||||||
name: List Active PR Runs
|
name: List Active PR Runs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
types: [synchronize]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
workflows:
|
workflows:
|
||||||
description: 'Space-separated list of workflow filenames to check (empty for all)'
|
description: 'Space-separated list of workflow filenames to check'
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: 'pr-test.yml'
|
default: 'pr-test.yml'
|
||||||
@@ -45,7 +43,6 @@ jobs:
|
|||||||
|
|
||||||
# Create a temporary file to store PR data
|
# Create a temporary file to store PR data
|
||||||
pr_data_file=$(mktemp)
|
pr_data_file=$(mktemp)
|
||||||
pr_retry_file=$(mktemp)
|
|
||||||
|
|
||||||
# Process each workflow
|
# Process each workflow
|
||||||
for workflow_file in ${workflow_files[@]}; do
|
for workflow_file in ${workflow_files[@]}; do
|
||||||
@@ -94,8 +91,8 @@ jobs:
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get jobs for this run
|
# Get jobs for this run (with pagination to avoid missing jobs)
|
||||||
jobs=$(gh api "repos/$REPO/actions/runs/$run_id/jobs" --jq '.jobs')
|
jobs=$(gh api "repos/$REPO/actions/runs/$run_id/jobs" --paginate --jq '.jobs[]' | jq -s '.')
|
||||||
|
|
||||||
running_jobs=$(echo "$jobs" | jq '[.[] | select(.status=="in_progress")] | length')
|
running_jobs=$(echo "$jobs" | jq '[.[] | select(.status=="in_progress")] | length')
|
||||||
queued_jobs=$(echo "$jobs" | jq '[.[] | select(.status=="queued" or .status=="waiting")] | length')
|
queued_jobs=$(echo "$jobs" | jq '[.[] | select(.status=="queued" or .status=="waiting")] | length')
|
||||||
|
|||||||
Reference in New Issue
Block a user