Skip to content

Commit 22bbc07

Browse files
committed
ci: improve failing workflow
1 parent 10194ce commit 22bbc07

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/sync-upstream-issues.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ jobs:
6565
CREATED_AT=$(echo "$issue" | jq -r '.created_at')
6666
TRACKING_LABEL="upstream-issue-$UPSTREAM_NUM"
6767
68-
# Check if issue already exists in fork using tracking label
68+
# Check if issue already exists in this fork using tracking label
6969
EXISTING=$(gh issue list \
70+
--repo "$GITHUB_REPOSITORY" \
7071
--label "$TRACKING_LABEL" \
7172
--json number \
7273
--jq '.[0].number // empty')
@@ -76,8 +77,10 @@ jobs:
7677
7778
# Ensure tracking label exists in this repository (gh cannot apply non-existent labels)
7879
gh label create "$TRACKING_LABEL" \
80+
--repo "$GITHUB_REPOSITORY" \
7981
--color "ededed" \
80-
--description "Cloned from upstream issue #$UPSTREAM_NUM" >/dev/null 2>&1 || true
82+
--description "Cloned from upstream issue #$UPSTREAM_NUM" \
83+
--force >/dev/null 2>&1
8184
8285
# Prepare issue body with upstream reference
8386
ISSUE_BODY="**Upstream Issue:** $UPSTREAM_REPO#$UPSTREAM_NUM
@@ -107,9 +110,11 @@ jobs:
107110
echo "✓ Created issue for upstream #$UPSTREAM_NUM"
108111
echo "$CREATE_OUTPUT"
109112
} || {
110-
echo " Failed to create issue for upstream #$UPSTREAM_NUM"
113+
echo " Failed to create issue for upstream #$UPSTREAM_NUM"
111114
echo " gh error:"
112115
echo "$CREATE_OUTPUT"
116+
# Fail fast on first creation error
117+
exit 1
113118
}
114119
fi
115120

0 commit comments

Comments
 (0)