Skip to content

Sync skills to distribution repo on release#172

Merged
jeremy merged 6 commits intomainfrom
skills-sync
Mar 1, 2026
Merged

Sync skills to distribution repo on release#172
jeremy merged 6 commits intomainfrom
skills-sync

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Feb 28, 2026

Summary

  • Add scripts/sync-skills.sh — copies skills/*/SKILL.md (and non-Go, non-dotfile assets) into basecamp/skills on each tagged release
  • Append sync-skills job to the release workflow, gated on needs: [release] and continue-on-error: true
  • Add make sync-skills TAG=v... and make sync-skills-remote TAG=v... for manual dry-run testing

Key behaviors:

  • Stale skill cleanup: manifest-driven (.managed-skills) — only deletes skills previously synced by this script, never touches other content in the target repo
  • Safety guards: exact github.com host + owner/repo URL validation, branch assertion
  • Push retry: single retry with rebase on non-fast-forward; immediate fail on auth/protection errors
  • Failure notification: creates/comments on a deduplicated issue in basecamp/skills, plus ::error annotation as fallback

Test plan

  • DRY_RUN=local — discovers skills, copies into tmpdir, shows diff
  • DRY_RUN=remote — clones target, copies, shows diff against real state (needs token)
  • Next v* tag — verify sync-skills job in Actions, check commit in basecamp/skills

Copilot AI review requested due to automatic review settings February 28, 2026 22:49
@github-actions github-actions bot added ci CI/CD workflows enhancement New feature or request labels Feb 28, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44bb9a7aa7

ℹ️ 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".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an automated skill synchronization pipeline that copies skill documentation from basecamp-cli to the basecamp/skills distribution repository on each release. It introduces a shell script for the sync logic, Makefile targets for local/remote dry-run testing, and a new CI job in the release workflow.

Changes:

  • Adds scripts/sync-skills.sh with manifest-driven stale cleanup, URL/branch safety guards, and a single non-fast-forward retry
  • Appends a sync-skills job to .github/workflows/release.yml, gated on the release job with continue-on-error: true and failure notification via GitHub issues
  • Adds make sync-skills and make sync-skills-remote targets for manual dry-run testing

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
scripts/sync-skills.sh Core sync script: discovers skills, copies non-Go assets, cleans up stale skills via .managed-skills manifest, commits and pushes with one non-fast-forward retry
.github/workflows/release.yml Adds sync-skills CI job that runs after release, generates an App token scoped to basecamp/skills, runs the sync script, and notifies on failure
Makefile Adds sync-skills (local DRY_RUN) and sync-skills-remote (remote DRY_RUN) targets for manual testing, with entries in the help text

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 28, 2026
Copilot AI review requested due to automatic review settings March 1, 2026 00:00
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 1, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 1, 2026
Copilot AI review requested due to automatic review settings March 1, 2026 00:37
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 1, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 1, 2026
Add scripts/sync-skills.sh that copies skills from this repo into the
basecamp/skills distribution repo on each tagged release. The release
workflow runs the script after a successful release, using the existing
GitHub App for authentication.

The script discovers skills via skills/*/SKILL.md, copies them
(excluding *.go and dotfiles), removes stale skills tracked by a
.managed-skills manifest, and commits with provenance metadata.
Safety guards validate the target remote URL (exact github.com host
match) and branch. Push failures from non-fast-forward are retried
once after rebase; other errors fail immediately.

DRY_RUN=local and DRY_RUN=remote modes support offline and
authenticated testing respectively. Makefile targets (sync-skills,
sync-skills-remote) expose these for manual use.

On sync failure, the workflow creates or comments on a deduplicated
issue in basecamp/skills and emits a ::error annotation.
- Reject '.' and '..' explicitly in manifest validation before the
  regex check, which would otherwise accept them
- Add SKILLS_TOKEN guard to sync-skills-remote Makefile target
- Wrap retry push in error handling so failures produce a clear message
When no .managed-skills manifest exists in the target repo, treat all
*/SKILL.md directories as previously managed so stale skills are
cleaned up on the first run rather than becoming permanent drift.

Also widen the manifest entry validator to accept mixed-case names.
- Set timeout-minutes: 10 on sync-skills job to match the convention
  set by the release job and avoid 6-hour hangs on network issues
- Redact credentials from the origin URL in assert_remote_url error
  messages so tokens are never logged
On first run (no .managed-skills manifest), all */SKILL.md directories
in the target are treated as managed. This is intentional — basecamp-cli
is the source of truth. DRY_RUN=remote can preview the effect.
Make variables aren't automatically exported as environment variables
to subprocesses — pass it explicitly like the other env vars.
Copilot AI review requested due to automatic review settings March 1, 2026 01:24
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 1, 2026
@jeremy jeremy merged commit 69e7d1d into main Mar 1, 2026
25 checks passed
@jeremy jeremy deleted the skills-sync branch March 1, 2026 01:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD workflows enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants