ci: fix the startup failure on merge to main - #10
Merged
Conversation
The first run of Publish Kotlin Nexus track died as startup_failure with zero jobs and no readable log. A caller's permissions block is the ceiling for every job in the called reusable workflow, and GitHub validates it at workflow-load time, before any `if:` is evaluated. The caller granted `packages: read`, while _track-ci.yml's build-image job asks for `packages: write`. build-image never runs here (build_image: false), but a disabled job still counts toward the check, so the whole run was rejected before it could log why. Raise the ceiling to `packages: write` and comment why it belongs next to `build_image: false`. Fixing that alone would only move the failure: this repo has no INSTRUQT_TOKEN secret, so `instruqt track push` would fail on auth every merge. Gate the push steps on a token check that warns and skips instead. Publishing stays manual until someone adds the secret, and nothing needs to change here when they do. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a GitHub Actions reusable-workflow startup failure on merges to main by aligning the caller workflow’s permissions ceiling with the called workflow’s job requirements, and adds documentation around the failure mode and token requirements for publishing an Instruqt track.
Changes:
- Raised caller workflow
packagespermission towriteto satisfy the reusable workflow’s (even-disabled)build-imagejob permissions. - Added an
INSTRUQT_TOKENpresence check and conditional gating around the publish steps to avoid hard failures when the secret is missing. - Documented both the permissions-ceiling trap and the missing-token behavior in
README.mdandINSTRUQT.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents current “no-op” publish behavior without INSTRUQT_TOKEN and explains the reusable-workflow permissions ceiling pitfall. |
| INSTRUQT.md | Adds a troubleshooting section explaining startup failures from permissions ceilings and guidance for handling missing tokens. |
| .github/workflows/build-and-push-kotlin.yml | Raises packages permission ceiling to prevent workflow-load startup failures when calling the reusable workflow. |
| .github/workflows/_track-ci.yml | Adds token-check step and conditions publishing steps on token presence to avoid failing merges when secret is absent. |
Suppressed comments (1)
.github/workflows/_track-ci.yml:120
- Validation is valuable signal even when publishing is intentionally disabled (no token). Since
instruqt track validatedoes not require auth, consider running this step unconditionally and leaving only the push step conditional onhas_token.
- name: Validate track
if: steps.auth.outputs.has_token == 'true'
working-directory: ${{ inputs.track_dir }}/instruqt
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
108
to
110
| - name: Install Instruqt CLI | ||
| if: steps.auth.outputs.has_token == 'true' | ||
| run: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first run of Publish Kotlin Nexus track (the one PR #9's merge triggered) died as
startup_failurewith zero jobs and no readable log.Why it failed at startup
A caller's
permissions:block is the ceiling for every job in the called reusable workflow, and GitHub validates that ceiling when it loads the workflow, before anyif:is evaluated.The caller granted
packages: read._track-ci.yml'sbuild-imagejob asks forpackages: write.build-imagenever runs here (build_image: false), but a disabled job still counts toward the check, so the run was rejected before it could log why.Raised the ceiling to
packages: write, with a comment explaining why that belongs next tobuild_image: falseso nobody narrows it back.Why that alone was not enough
This repo has no
INSTRUQT_TOKENsecret (checked both repo and org scope). Fixing the ceiling would have converted a startup failure into an auth failure oninstruqt track pushon every merge.The push steps now run behind a token check that emits a
::warning::naming the fix and skips. Publishing stays manual until someone adds the secret, and nothing here has to change when they do. The check is a step, not a job-levelif, because thesecretscontext is not available in the latter.Impact on the live track
None. The track is already published and
instruqt track pullreports it up to date, so the skipped push would have been a no-op anyway.Verification
_track-ci.yml:contents: readok,packages: writeok.Also documented both traps in
INSTRUQT.mdand the token requirement inREADME.md.🤖 Generated with Claude Code