Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

ci: don't fail fork PRs when label/check API calls 403 (#4959)

LearningCircuit032a59d59f5d
diff --git a/.github/workflows/advanced-search-reminder.yml b/.github/workflows/advanced-search-reminder.yml
index 3bad4b778e..f96a8ac993 100644
--- a/.github/workflows/advanced-search-reminder.yml
+++ b/.github/workflows/advanced-search-reminder.yml
@@ -2,8 +2,11 @@ name: Advanced-search change reminder
on:
# pull_request (not pull_request_target) — fork PRs get a read-only
- # token and addLabels will 403 silently. Intentional: advisory label
- # is only meaningful for internal-branch PRs anyway.
+ # token, so the label call 403s; the script catches that and stays
+ # green (the original comment claimed the 403 was silent, but nothing
+ # caught it, so fork PRs got a red check — e.g. #4872). Intentional
+ # no-op on forks: the advisory label is only meaningful for
+ # internal-branch PRs anyway.
pull_request:
types: [opened, synchronize, reopened]
paths:
@@ -39,9 +42,17 @@ jobs:
// The label's description (set on the label itself in repo
// settings) carries the reminder text so reviewers see it
// on hover without needing an inline comment.
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- labels: ['benchmark-needed']
- });
+ try {
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number,
+ labels: ['benchmark-needed']
+ });
+ } catch (err) {
+ // Fork PRs get a read-only token — the call 403s ("Resource
+ // not accessible by integration"). Advisory label only, so
+ // log and stay green (same pattern as pr-triage.yml).
+ if (err.status !== 403) throw err;
+ console.log('Label call returned 403 (read-only fork token). Skipping.');
+ }
diff --git a/.github/workflows/danger-zone-alert.yml b/.github/workflows/danger-zone-alert.yml
index a40076c431..4f49a084e1 100644
--- a/.github/workflows/danger-zone-alert.yml
+++ b/.github/workflows/danger-zone-alert.yml
@@ -148,18 +148,26 @@ jobs:
// Neutral check — advisory, not blocking. Real enforcement, if
// desired, belongs in branch-protection rules, not in a status
// title that misleads reviewers.
- await github.rest.checks.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- name: 'Security Review Required',
- head_sha: context.sha,
- status: 'completed',
- conclusion: 'neutral',
- output: {
- title: 'Security-sensitive paths modified',
- summary: 'This PR modifies critical security code (encryption, authentication, or web hardening). Please review carefully.'
- }
- });
+ try {
+ await github.rest.checks.create({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ name: 'Security Review Required',
+ head_sha: context.sha,
+ status: 'completed',
+ conclusion: 'neutral',
+ output: {
+ title: 'Security-sensitive paths modified',
+ summary: 'This PR modifies critical security code (encryption, authentication, or web hardening). Please review carefully.'
+ }
+ });
+ } catch (err) {
+ // Fork PRs get a read-only token — checks.create 403s. Log
+ // and stay green (same pattern as pr-triage.yml); reviewers
+ // still get the signal from CODEOWNERS on these paths.
+ if (err.status !== 403) throw err;
+ console.log('checks.create returned 403 (read-only fork token). Skipping.');
+ }
- name: Add labels
if: steps.analyze.outputs.has_critical == 'true'
@@ -194,14 +202,23 @@ jobs:
description: l.description,
});
} catch (e) {
- // 422 = already exists; anything else is a real failure.
- if (e.status !== 422) throw e;
+ // 422 = already exists. 403 = read-only fork token (the
+ // addLabels call below degrades the same way).
+ if (e.status !== 422 && e.status !== 403) throw e;
}
}
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- labels: wanted.map(l => l.name),
- });
+ try {
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number,
+ labels: wanted.map(l => l.name),
+ });
+ } catch (err) {
+ // Fork PRs get a read-only token — the call 403s. Log and
+ // stay green (same pattern as pr-triage.yml); a maintainer
+ // can apply the labels manually on fork PRs.
+ if (err.status !== 403) throw err;
+ console.log('Label call returned 403 (read-only fork token). Skipping.');
+ }