Skip to content

Commit d85cd6d

Browse files
committed
fix(ci): tolerate label create 403 in forks
Avoid failing CI when ensure_label hits "Resource not accessible by integration" in restricted contexts. Keep label sync best-effort for fork/integration permission limits.
1 parent 4cfc6b3 commit d85cd6d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/scripts/ci-helpers.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ ensure_label() {
5252
return 0
5353
fi
5454

55+
# In restricted integration contexts (e.g., fork PRs), label creation can
56+
# return 403 "Resource not accessible by integration". Do not fail the
57+
# workflow in this case; label add/remove operations are already best-effort.
58+
if grep -q 'Resource not accessible by integration' "${err_file}"; then
59+
echo "::warning::Skipping label creation for $1 due to integration permissions." >&2
60+
rm -f "${err_file}"
61+
return 0
62+
fi
63+
5564
echo "::warning::Failed to ensure label $1." >&2
5665
if [ -s "${err_file}" ]; then
5766
cat "${err_file}" >&2

0 commit comments

Comments
 (0)