Skip to content
Open
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
7 changes: 5 additions & 2 deletions .github/workflows/rerun-danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ jobs:
"https://circleci.com/api/v2/pipeline/$PIPELINE_ID/workflow" \
| jq -c --arg name "$WORKFLOW_NAME" 'first(.items[] | select(.name == $name))')

# If the target workflow doesn't exist yet, CircleCI hasn't created
# the pipeline run for this label change. The initial run will
# execute once it does, so there's nothing to rerun.
if [[ -z "$TARGET_WORKFLOW" || "$TARGET_WORKFLOW" == "null" ]]; then
echo "::error::No '$WORKFLOW_NAME' workflow found in pipeline $PIPELINE_ID"
exit 1
echo "No '$WORKFLOW_NAME' workflow in pipeline $PIPELINE_ID yet — skipping rerun."
exit 0
fi

WORKFLOW_ID=$(echo "$TARGET_WORKFLOW" | jq -r '.id')
Expand Down