Skip to content

fix(sync-ai-rules): reusable workflow fails — no rules/ directory or .rulesync config #10

Description

@laurigates

Summary

reusable-sync-ai-rules.yml fails at runtime when called from a consumer repo. The workflow assumes laurigates/.github has a rules/ directory at the root and that the consumer repo has a .rulesync/ config, but neither exists.

Reproduction

Run Sync AI Rules in any consumer repo, e.g. mcu-tinkering-lab run 24399454041.

Observed failure

Step 3 (npx rulesync@latest fetch laurigates/.github --features rules,ignore --conflict overwrite):

GET /repos/laurigates/.github/contents/rules?ref=main - 404
No files found matching enabled features: rules, ignore
No files were fetched.
Summary: no files

Step 4 (npx rulesync@latest generate):

.rulesync directory not found. Run 'rulesync init' first.
##[error]Process completed with exit code 1.

Root cause

  • The workflow fetches rules/ from laurigates/.github@main, but that directory does not exist in the repo.
  • rulesync generate requires a .rulesync/ directory in the consumer repo; the workflow never runs rulesync init to create one.

Suggested fix

Pick whichever matches the intent of the workflow:

  1. Source of truth is in laurigates/.github: add a rules/ directory to this repo containing the canonical rule files, so rulesync fetch has something to pull.
  2. Source of truth is elsewhere: update the fetch call to point at the correct repo/path.
  3. Add a bootstrap step: run npx rulesync@latest init in the consumer repo before generate so a missing .rulesync/ doesn't hard-fail (and fetch has somewhere to write).

Option 3 alone won't help if fetch still returns zero files — the root cause is that the upstream rules/ directory is missing.

Related

  • Port of workflow came from ForumViriumHelsinki/.github — the FVH version likely has a rules/ dir that wasn't copied over.
  • Consumer workflows affected: mcu-tinkering-lab at minimum; likely others that adopted this reusable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions