|
| 1 | +# CLAUDE.md — AI Assistant Context |
| 2 | + |
| 3 | +This file provides context for AI coding assistants (Claude, Cursor, GitHub Copilot). |
| 4 | +For full documentation, see the [`documentation/`](./documentation/) directory. |
| 5 | + |
| 6 | +## What This Repository Is |
| 7 | + |
| 8 | +A mono-repo of reusable [composite GitHub Actions](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action) |
| 9 | +used across GenUI's CI/CD pipelines. All actions are composite actions (YAML + shell scripts) — |
| 10 | +not Docker or JavaScript actions. |
| 11 | + |
| 12 | +Consumers reference actions via: |
| 13 | + |
| 14 | +```yaml |
| 15 | +uses: generalui/github-workflow-accelerators/.github/actions/{action-name}@{version-tag} |
| 16 | +``` |
| 17 | +
|
| 18 | +## Repository Structure |
| 19 | +
|
| 20 | +```text |
| 21 | +.github/ |
| 22 | + actions/ |
| 23 | + {action-name}/ |
| 24 | + action.yml # Composite action definition |
| 25 | + project.json # Version — MUST be bumped on every change to this action |
| 26 | + README.md # Action documentation |
| 27 | + scripts/ # Shell scripts invoked by action.yml |
| 28 | + workflows/ |
| 29 | + code-quality.yml # PR gate: markdownlint + per-action bats tests |
| 30 | + create-release.yml # Auto-releases on merge to main |
| 31 | +tests/ |
| 32 | + unit/ |
| 33 | + {action-name}/ # bats tests for that action's shell scripts |
| 34 | + helpers/ |
| 35 | + mock_helpers.bash # Shared mock utilities |
| 36 | +documentation/ # Contributor and DevOps guides |
| 37 | +``` |
| 38 | + |
| 39 | +## Critical: Versioning Contract |
| 40 | + |
| 41 | +**Every change to an action requires a `project.json` version bump. No exceptions.** |
| 42 | + |
| 43 | +- Patch (1.0.0 → 1.0.1): bug fixes, dependency updates, documentation, refactors |
| 44 | +- Minor (1.0.0 → 1.1.0): new optional inputs, backwards-compatible features |
| 45 | +- Major (1.0.0 → 2.0.0): breaking changes to inputs or outputs |
| 46 | + |
| 47 | +Skipping the version bump causes `create-release.yml` to fail on merge to `main` with a |
| 48 | +"tag already exists" error. |
| 49 | + |
| 50 | +See [UPDATING_AN_ACTION.md](./documentation/UPDATING_AN_ACTION.md). |
| 51 | + |
| 52 | +## CI vs Release Triggers |
| 53 | + |
| 54 | +**`code-quality.yml`** (PR gate) — runs on PRs to `main`: |
| 55 | + |
| 56 | +- Markdownlint: fires when any `**/*.md` file changes |
| 57 | +- bats tests: fires per-action when files in `.github/actions/{name}/` or `tests/unit/{name}/` change |
| 58 | +- To add a new testable action, add its name to the `actions_with_tests` array in `code-quality.yml` |
| 59 | + |
| 60 | +**`create-release.yml`** (release) — runs on push to `main`: |
| 61 | + |
| 62 | +- Reads `project.json` from each changed action directory |
| 63 | +- Ignores: `documentation/`, `tests/`, `*.md`, `.github/workflows/`, config files |
| 64 | +- Creates tag `{version}-{action-name}` and GitHub Release per changed action |
| 65 | + |
| 66 | +See [DEVOPS.md](./documentation/DEVOPS.md), [CODE_QUALITY.md](./documentation/CODE_QUALITY.md), |
| 67 | +and [CREATE_RELEASE.md](./documentation/CREATE_RELEASE.md). |
| 68 | + |
| 69 | +## Adding or Modifying Actions |
| 70 | + |
| 71 | +- **Adding**: [ADDING_AN_ACTION.md](./documentation/ADDING_AN_ACTION.md) |
| 72 | +- **Modifying**: [UPDATING_AN_ACTION.md](./documentation/UPDATING_AN_ACTION.md) |
| 73 | +- **Testing**: [WRITING_TESTS.md](./documentation/WRITING_TESTS.md) |
| 74 | +- **Contributing**: [CONTRIBUTING.md](./documentation/CONTRIBUTING.md) |
| 75 | + |
| 76 | +## Key Conventions |
| 77 | + |
| 78 | +- `main` is protected — all changes via PR; direct commits are blocked |
| 79 | +- Shell scripts: `#!/usr/bin/env bash`, inputs passed via env vars not positional args |
| 80 | +- Tests: bats, `REPO_ROOT="$(cd "$BATS_TEST_DIRNAME/../../.." && pwd)"` (3 levels deep) |
| 81 | +- Internal action references are pinned to a specific release tag |
| 82 | +- New actions start at version `1.0.0` |
0 commit comments