Repository navigation
feat(check): add --exit-code to fail when anything is not up to date - #865
Conversation
`check` exits 1 only when an item could not be checked. A CI job that wants to fail on pending updates or local edits had to parse `--json` and compare statuses itself. `--exit-code` makes a check that ran cleanly exit 1 when any skill, tracked repository or agent is not up to date. Items with a local source do not count, and the default exit status is unchanged. The operation log still records such a run as successful, because the check itself did not fail. The flag is rejected with `--diff`, which prints a comparison and has no status to gate on.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The built-in skill's agents reference listed only `check agents --json`, so an agent asked to gate CI on agent drift would not learn the flag from it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a09c5c2406
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| `check` exits with code `1` if any checked item has status `error` (for example, an unreachable remote or a missing local source). Available updates, stale items, and local modifications alone do not cause failure. With `--json`, stdout still contains the complete results; inspect each item's `status` and `message` for details. | ||
|
|
||
| Pass `--exit-code` to also exit with code `1` when every item could be checked but something is not up to date: an available update, a stale or locally modified skill, or a tracked repository that is behind, has uncommitted changes, or is missing. Items with a local source do not count. The same applies to `check agents`, where an agent whose file changed since install also counts. It works with `--json` and cannot be combined with `--diff`. |
There was a problem hiding this comment.
Clarify which local items are excluded from the CI gate
For a supported local-path installation such as skillshare install ./vendor/team-skill -p, changing the source causes LocalSourceStatus to return update_available, and check -p --exit-code exits 1—as the new TestCheckProject_ExitCode_FailsOnceSourceChanges explicitly verifies. Thus, “Items with a local source do not count” incorrectly promises that these installations cannot fail the CI gate. Clarify that only items whose status is local are excluded, rather than all local-source installations, and correct the same statement in the Japanese, Korean, Simplified Chinese, and Traditional Chinese check.md translations.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ef9e9b3. The sentence now says that only items whose status is local (nothing to compare) are left out, and that a local-path install whose source changed is an available update and counts. Corrected in the English page and the ja, ko, zh-Hans and zh-Hant translations, and in the PR description, which had the same sentence. No code change: TestCheckProject_ExitCode_FailsOnceSourceChanges already covers the behavior. The help text, completions and built-in skill do not make the claim.
The check page said items with a local source do not count toward --exit-code. A skill installed from a local path whose source changed is reported as update_available and does make the command exit 1, as the project-mode test shows. Only items with status `local`, which have nothing to compare against, are left out. Correct the sentence in English and the four translations.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The row says skills check exits 1 on updates or local changes, while the Skillshare cell listed only check and update, which reads as if Skillshare cannot gate CI on drift. check --exit-code (#865) does that.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)A small feature opened at the maintainer's request. There is no linked issue, so the last box stays unticked.
Linked Issue
None.
What and why
skillshare checkexits 1 only when an item could not be checked. A CI job that wants to fail on pending updates or local edits has to parse--jsonand compare statuses itself.--exit-codeis opt-in. With it, a check that ran cleanly exits 1 when anything is not up to date:update_available,stale,modifiedbehind,dirty,missingcheck agents):update_available,drifted,dirtyOnly items whose status is
local(nothing to compare) are left out; a local-path install whose source changed isupdate_availableand counts. Without the flag the exit status is unchanged. With--jsonthe full results are still printed and only the exit code changes. The operation log records such a run as successful, because the check itself did not fail. The flag is rejected together with--diff.Also updated:
--help, all five shell completions,check.mdin English and four translations, and the built-in skill'schecksection.Checks
make checkin a devcontainer-image container on the worktree: exit 0, before the rebase ontomain. The rebase only brought in docs(comparison): re-pin the npx skills comparison to v1.8.1 #864 (docs and.gitignore).--json), a single named target, project mode with a changed local source,check agentswith a drifted agent, the up-to-date case, the--diffconflict, and the completion strings for five shells.skillshare-code-reviewskill; its confirmed findings are fixed.Not covered
These exist on
mainwithout the flag and are left for follow-ups:check --alldoes not check agents, so--all --exit-codedoes not gate on them. Usecheck agents --exit-code.check <unknown-name> --jsonprints empty results and exits 0, with or without the flag.Checklist
make check) — for code changes