From d40671c114030d86abe5549992b1b609032f8636 Mon Sep 17 00:00:00 2001 From: Val Redchenko Date: Tue, 2 Jun 2026 17:25:06 +0100 Subject: [PATCH] fix(ci): make devtools dispatch best-effort in publish-openapi-spec A present-but-unauthorised DEVTOOLS_DISPATCH_TOKEN (e.g. a fine-grained PAT pending org approval) made the dispatch step 403 and failed the whole publish run, even though the canonical spec commit - the critical output - succeeded. The notification is best-effort (devtools also syncs on schedule and manually), so a failed dispatch now warns instead of failing the workflow. --- .github/workflows/publish-openapi-spec.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-openapi-spec.yml b/.github/workflows/publish-openapi-spec.yml index b9bcc22b..a90c6f6e 100644 --- a/.github/workflows/publish-openapi-spec.yml +++ b/.github/workflows/publish-openapi-spec.yml @@ -60,5 +60,10 @@ jobs: echo "::warning::DEVTOOLS_DISPATCH_TOKEN not set - spec committed but smartem-devtools not notified." exit 0 fi - gh api repos/DiamondLightSource/smartem-devtools/dispatches \ - -f event_type=openapi-spec-updated + # Best-effort nudge: the spec commit above is the critical output, and + # smartem-devtools also syncs on a schedule and on manual dispatch, so a + # failed notification (e.g. a token pending org approval) must not fail + # this workflow. + if ! gh api repos/DiamondLightSource/smartem-devtools/dispatches -f event_type=openapi-spec-updated; then + echo "::warning::Could not notify smartem-devtools (token pending approval or transient error). Spec is committed; devtools will pick it up via its scheduled or manual sync." + fi