{"id":48617124,"url":"https://github.com/getlumos/lumos-action","last_synced_at":"2026-04-09T02:12:30.063Z","repository":{"id":325589699,"uuid":"1101735600","full_name":"getlumos/lumos-action","owner":"getlumos","description":"GitHub Action for LUMOS schema generation and validation","archived":false,"fork":false,"pushed_at":"2026-02-06T08:24:11.000Z","size":118,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-06T16:32:05.209Z","etag":null,"topics":["automation","blockchain","borsh","ci-cd","code-generation","codegen","continuous-integration","developer-tools","devops","github-action","github-actions","lumos","rust","schema","schema-language","solana","type-safety","typescript","validation","workflow"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getlumos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T06:16:18.000Z","updated_at":"2026-02-06T08:24:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/getlumos/lumos-action","commit_stats":null,"previous_names":["getlumos/lumos-action"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/getlumos/lumos-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlumos%2Flumos-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlumos%2Flumos-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlumos%2Flumos-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlumos%2Flumos-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getlumos","download_url":"https://codeload.github.com/getlumos/lumos-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlumos%2Flumos-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31581886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","blockchain","borsh","ci-cd","code-generation","codegen","continuous-integration","developer-tools","devops","github-action","github-actions","lumos","rust","schema","schema-language","solana","type-safety","typescript","validation","workflow"],"created_at":"2026-04-09T02:12:29.973Z","updated_at":"2026-04-09T02:12:30.045Z","avatar_url":"https://github.com/getlumos.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# LUMOS Generate Action\n\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-LUMOS%20Generate-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=github)](https://github.com/marketplace/actions/lumos-generate)\n[![License](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT)\n\nGitHub Action for automatic LUMOS schema generation and validation in CI/CD pipelines.\n\n**Why use this action?**\n- Prevent type drift between Rust and TypeScript in your Solana projects\n- Automate schema validation on every PR\n- Catch schema changes before they break production\n- Zero-config installation - works out of the box\n\n## Quick Start\n\n```yaml\n- uses: actions/checkout@v4\n- uses: getlumos/lumos-action@v1\n  with:\n    schema: 'schemas/**/*.lumos'\n```\n\n## Features\n\n- ✅ Auto-install LUMOS CLI (any version)\n- ✅ Validate LUMOS schemas\n- ✅ Generate Rust + TypeScript code\n- ✅ Detect drift between generated and committed files\n- ✅ Post PR comments with diff summaries\n- ✅ Configurable failure modes\n\n## Usage\n\n### Basic Generation\n\n```yaml\nname: LUMOS Generate\n\non: [push, pull_request]\n\njobs:\n  generate:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Generate from LUMOS schemas\n        uses: getlumos/lumos-action@v1\n        with:\n          schema: 'schemas/**/*.lumos'\n```\n\n### Validation Only (PR Checks)\n\n```yaml\nname: LUMOS Validate\n\non: [pull_request]\n\njobs:\n  validate:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Validate LUMOS schemas\n        uses: getlumos/lumos-action@v1\n        with:\n          schema: 'schemas/**/*.lumos'\n          check-only: true\n          fail-on-drift: true\n```\n\n### Advanced Configuration\n\n```yaml\n- name: Generate with custom version\n  uses: getlumos/lumos-action@v1\n  with:\n    schema: 'programs/**/schema.lumos'\n    version: '0.1.1'\n    working-directory: './backend'\n    fail-on-drift: false\n    comment-on-pr: true\n```\n\n## Inputs\n\n| Input | Description | Required | Default |\n|-------|-------------|----------|---------|\n| `schema` | Path to schema files (supports globs) | Yes | - |\n| `check-only` | Only validate, do not generate | No | `false` |\n| `version` | LUMOS CLI version to install | No | `latest` |\n| `working-directory` | Working directory for commands | No | `.` |\n| `fail-on-drift` | Fail if drift detected | No | `true` |\n| `comment-on-pr` | Post PR comment with results | No | `true` |\n\n## Outputs\n\n| Output | Description |\n|--------|-------------|\n| `schemas-validated` | Number of schemas validated |\n| `schemas-generated` | Number of schemas generated |\n| `drift-detected` | Whether drift was detected |\n| `diff-summary` | Summary of differences |\n\n## Examples\n\n### Monorepo with Multiple Schemas\n\n```yaml\n- name: Generate all schemas\n  uses: getlumos/lumos-action@v1\n  with:\n    schema: |\n      programs/nft/schema.lumos\n      programs/defi/schema.lumos\n      programs/gaming/schema.lumos\n```\n\n### Specific Version Pinning\n\n```yaml\n- name: Generate with pinned version\n  uses: getlumos/lumos-action@v1\n  with:\n    schema: 'schema.lumos'\n    version: '0.1.1'\n```\n\n### Custom Failure Behavior\n\n```yaml\n- name: Generate with warnings only\n  uses: getlumos/lumos-action@v1\n  with:\n    schema: 'schemas/*.lumos'\n    fail-on-drift: false  # Only warn, don't fail\n```\n\n## Workflow Tips\n\n### Pre-commit Hook Alternative\n\nUse this action as a pre-commit check in CI:\n\n```yaml\non:\n  pull_request:\n    paths:\n      - '**/*.lumos'\n\njobs:\n  check-schemas:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: getlumos/lumos-action@v1\n        with:\n          schema: '**/*.lumos'\n          check-only: true\n```\n\n### Auto-commit Generated Files\n\n```yaml\n- uses: getlumos/lumos-action@v1\n  with:\n    schema: 'schema.lumos'\n    fail-on-drift: false\n\n- name: Commit generated files\n  run: |\n    git config user.name \"LUMOS Bot\"\n    git config user.email \"bot@lumos-lang.org\"\n    git add .\n    git commit -m \"chore: Update generated files\" || exit 0\n    git push\n```\n\n## Advanced Usage\n\n### Multi-Language Generation\n\nLUMOS **always generates both Rust and TypeScript** from a single schema. You cannot generate only one language - this ensures type-safe serialization compatibility between Solana programs and clients.\n\n**What gets generated:**\n```yaml\n- uses: getlumos/lumos-action@v1\n  with:\n    schema: 'schemas/player.lumos'\n\n# Result:\n# schemas/generated.rs   ← Rust (Anchor/Borsh)\n# schemas/generated.ts   ← TypeScript + Borsh schemas\n```\n\n**To separate languages into different directories:**\n\n```yaml\n- uses: getlumos/lumos-action@v1\n  with:\n    schema: 'schemas/**/*.lumos'\n\n- name: Organize by language\n  run: |\n    mkdir -p generated/rust generated/typescript\n    find schemas -name \"generated.rs\" -exec mv {} generated/rust/ \\;\n    find schemas -name \"generated.ts\" -exec mv {} generated/typescript/ \\;\n```\n\nSee [docs/multi-language.md](docs/multi-language.md) for:\n- ✅ Why both languages are generated\n- ✅ Workarounds for language separation\n- ✅ Monorepo organization patterns\n- ✅ File renaming strategies\n\n### Custom Output Paths\n\nGenerated files appear **in the same directory** as the schema file. Custom output paths are not directly supported.\n\n**Default behavior:**\n```\nschemas/\n├── player.lumos\n├── generated.rs    ← Generated here\n└── generated.ts    ← Generated here\n```\n\n**Workaround - Post-generation move:**\n\n```yaml\n- uses: getlumos/lumos-action@v1\n  with:\n    schema: 'schemas/**/*.lumos'\n\n- name: Move to custom location\n  run: |\n    mkdir -p custom/output/path\n    find schemas -name \"generated.*\" -exec mv {} custom/output/path/ \\;\n```\n\nSee [docs/custom-output-paths.md](docs/custom-output-paths.md) for:\n- ✅ Working directory vs output path\n- ✅ 10+ organization patterns\n- ✅ Monorepo centralized vs distributed\n- ✅ Dynamic configuration examples\n\n### Monorepo Support\n\nFor projects with multiple packages, use matrix strategy to validate each package independently.\n\n**Basic Per-Package Validation:**\n\n```yaml\njobs:\n  generate:\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        package: [auth, payments, users, analytics]\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: getlumos/lumos-action@v1\n        with:\n          schema: 'packages/${{ matrix.package }}/schemas/*.lumos'\n          working-directory: 'packages/${{ matrix.package }}'\n```\n\n**Benefits:**\n- ✅ Each package validated independently\n- ✅ Parallel execution (faster for large monorepos)\n- ✅ Failures isolated per package\n- ✅ Package-specific drift detection\n\n**Advanced Features:**\n\n**Per-Package Drift Detection** - Matrix strategy with path filtering:\n\n```yaml\njobs:\n  detect-changes:\n    outputs:\n      packages: ${{ steps.filter.outputs.changes }}\n    steps:\n      - uses: dorny/paths-filter@v3\n        id: filter\n        with:\n          filters: |\n            auth: 'packages/auth/**'\n            payments: 'packages/payments/**'\n\n  validate:\n    needs: detect-changes\n    strategy:\n      matrix:\n        package: ${{ fromJSON(needs.detect-changes.outputs.packages) }}\n    steps:\n      - uses: getlumos/lumos-action@v1\n        with:\n          schema: 'packages/${{ matrix.package }}/schemas/*.lumos'\n```\n\n**Selective Failure Strategies** - Criticality-based validation tiers:\n\n```yaml\njobs:\n  # Critical packages - must pass (blocks merge)\n  critical:\n    strategy:\n      matrix:\n        package: [auth, payments]\n    steps:\n      - uses: getlumos/lumos-action@v1\n        with:\n          fail-on-drift: true\n\n  # Standard packages - warn only (allows merge)\n  standard:\n    continue-on-error: true\n    strategy:\n      matrix:\n        package: [users, analytics]\n    steps:\n      - uses: getlumos/lumos-action@v1\n        with:\n          fail-on-drift: true\n```\n\n**Breaking Change Detection** - Git diff analysis for schema changes:\n\nSee [docs/monorepo-advanced.md](docs/monorepo-advanced.md) for:\n- ✅ Per-package drift detection with matrix + path filters\n- ✅ Selective failure strategies (criticality tiers)\n- ✅ Breaking change detection (field removals, type changes)\n- ✅ Package-specific build failure control\n- ✅ Feature requests for native support\n\n**Complete Examples:**\n- [Monorepo Multi-Package](examples/workflows/monorepo-multi-package.yml) - 7 monorepo strategies\n- [Per-Package Validation](examples/workflows/monorepo-per-package.yml) - Matrix with path filtering\n- [Tiered Validation](examples/workflows/monorepo-tiered-validation.yml) - Criticality-based enforcement\n- [Breaking Change Detection](examples/workflows/breaking-change-detection.yml) - Git diff analysis\n- [Setup Guide](examples/monorepo-setup-guide.md) - Step-by-step monorepo setup\n\n### Preventing PR Merges\n\nEnforce different validation rules for PRs vs main branch, with GitHub branch protection integration.\n\n**Branch-Conditional Validation:**\n\n```yaml\n- uses: getlumos/lumos-action@v1\n  with:\n    schema: 'schemas/**/*.lumos'\n    # Strict on PRs, lenient on main\n    fail-on-drift: ${{ github.event_name == 'pull_request' }}\n```\n\n**Behavior:**\n- **Pull Requests:** Fails if drift detected → blocks merge via required status check\n- **Main Branch:** Warns but doesn't fail → allows push and auto-commit\n\n**GitHub Branch Protection Integration:**\n\n1. **Configure Repository Settings:**\n   - Settings → Branches → Add rule for `main`\n   - ✅ Require status checks to pass before merging\n   - Select status check: `validate` (your workflow job name)\n   - ✅ Require branches to be up to date before merging\n\n2. **Workflow Setup:**\n   ```yaml\n   name: validate  # This becomes the required status check\n\n   on:\n     pull_request:\n       branches: [main]\n\n   jobs:\n     schema-validation:\n       runs-on: ubuntu-latest\n       steps:\n         - uses: actions/checkout@v4\n         - uses: getlumos/lumos-action@v1\n           with:\n             schema: 'schemas/**/*.lumos'\n             fail-on-drift: true  # Blocks merge if drift detected\n   ```\n\n**Result:** GitHub prevents merging until validation passes.\n\n**Manual Approval for Schema Drift:**\n\nAllow maintainers to approve PRs with drift after review:\n\n```yaml\n- name: Check for manual approval\n  if: steps.lumos.outputs.drift-detected == 'true'\n  uses: actions/github-script@v7\n  with:\n    script: |\n      const { data: labels } = await github.rest.issues.listLabelsOnIssue({\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        issue_number: context.issue.number,\n      });\n\n      const hasApproval = labels.some(l =\u003e l.name === 'schema-drift-approved');\n\n      if (!hasApproval) {\n        core.setFailed('Add label \"schema-drift-approved\" to proceed');\n      }\n```\n\n**Emergency Hotfix Bypass:**\n\nAllow critical fixes to bypass validation:\n\n```yaml\n- name: Check for hotfix label\n  id: hotfix\n  uses: actions/github-script@v7\n  with:\n    result-encoding: string\n    script: |\n      const { data: labels } = await github.rest.issues.listLabelsOnIssue({\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        issue_number: context.issue.number,\n      });\n      return labels.some(l =\u003e l.name === 'hotfix') ? 'true' : 'false';\n\n- uses: getlumos/lumos-action@v1\n  with:\n    fail-on-drift: ${{ steps.hotfix.outputs.result != 'true' }}\n```\n\nSee [docs/branch-protection.md](docs/branch-protection.md) for:\n- ✅ Complete branch protection setup guide\n- ✅ 4 enforcement strategies (conditional, GitHub integration, manual approval, emergency override)\n- ✅ Team-based approval workflows\n- ✅ Hotfix patterns and best practices\n- ✅ Troubleshooting guide\n\n**Complete Examples:**\n- [Branch Protection Setup](examples/workflows/branch-protection.yml) - Production-ready complete setup\n- [Manual Approval Workflow](examples/workflows/manual-approval.yml) - Label, user, and team-based approval\n- [Emergency Override](examples/workflows/emergency-override.yml) - Hotfix bypass patterns\n\n### Example Workflows\n\n**Separate Rust and TypeScript:**\n- [examples/workflows/separate-rust-typescript.yml](examples/workflows/separate-rust-typescript.yml)\n  - 9 language separation patterns\n  - Rename with schema names\n  - Symbolic links\n  - Language-specific processing\n\n**Custom Output Organization:**\n- [examples/workflows/custom-output-organization.yml](examples/workflows/custom-output-organization.yml)\n  - 10 organization patterns\n  - Module-based organization\n  - Versioned outputs\n  - Workspace integration (Cargo/npm)\n  - CI/CD optimized structure\n\n**Monorepo Multi-Package:**\n- [examples/workflows/monorepo-multi-package.yml](examples/workflows/monorepo-multi-package.yml)\n  - Matrix generation strategy\n  - Centralized code collection\n  - Auto-commit on main branch\n  - Per-package custom naming\n\n## Customizing PR Comments\n\nThe action provides default PR comments, but you can create custom formats using the outputs.\n\n### Default Comment Behavior\n\nWhen `comment-on-pr: true` (default), the action posts:\n- Validation and generation statistics\n- Drift status\n- Collapsible diff summary (if drift detected)\n\n### Output Format\n\nThe `diff-summary` output contains markdown-formatted text:\n\n```markdown\n## 📊 LUMOS Generation Drift Detected\n\nThe following files differ from their generated versions:\n\n- `generated.rs`\n- `generated.ts`\n\n\u003cdetails\u003e\n\u003csummary\u003eView full diff\u003c/summary\u003e\n\n```diff\n[git diff output]\n```\n\n\u003c/details\u003e\n```\n\n### Custom Comment Examples\n\n**Minimal comment:**\n\n```yaml\n- uses: getlumos/lumos-action@v1\n  id: lumos\n  with:\n    schema: 'schemas/**/*.lumos'\n    comment-on-pr: false\n\n- name: Custom minimal comment\n  uses: actions/github-script@v7\n  with:\n    script: |\n      const drift = '${{ steps.lumos.outputs.drift-detected }}' === 'true';\n      const status = drift ? '⚠️ Drift detected' : '✅ All good';\n\n      await github.rest.issues.createComment({\n        issue_number: context.issue.number,\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        body: `**LUMOS:** ${status}`\n      });\n```\n\n**Team mentions on drift:**\n\n```yaml\n- name: Notify team on drift\n  if: steps.lumos.outputs.drift-detected == 'true'\n  uses: actions/github-script@v7\n  with:\n    script: |\n      await github.rest.issues.createComment({\n        issue_number: context.issue.number,\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        body: '@org/schema-maintainers Schema drift detected - please review'\n      });\n```\n\n**Parsed file list:**\n\n```yaml\n- name: Parse and list changed files\n  uses: actions/github-script@v7\n  with:\n    script: |\n      const diffSummary = `${{ steps.lumos.outputs.diff-summary }}`;\n      const files = [...diffSummary.matchAll(/`([^`]+\\.(rs|ts))`/g)]\n        .map(m =\u003e m[1]);\n\n      const comment = `**Changed files:** ${files.length}\\n\\n` +\n        files.map(f =\u003e `- \\`${f}\\``).join('\\n');\n\n      await github.rest.issues.createComment({\n        issue_number: context.issue.number,\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        body: comment\n      });\n```\n\n**Auto-label on drift:**\n\n```yaml\n- name: Add drift label\n  if: steps.lumos.outputs.drift-detected == 'true'\n  uses: actions/github-script@v7\n  with:\n    script: |\n      await github.rest.issues.addLabels({\n        issue_number: context.issue.number,\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        labels: ['schema-drift']\n      });\n```\n\nSee [examples/workflows/custom-pr-comments.yml](examples/workflows/custom-pr-comments.yml) for complete examples.\n\n## Understanding Failures\n\nThe action can fail for different reasons. Understanding the difference helps with debugging.\n\n### Failure Types\n\n| Type | Description | When It Fails | Configurable? |\n|------|-------------|---------------|---------------|\n| **Validation Error** | Schema syntax or type errors | Always | ❌ No - Must fix |\n| **Generation Error** | Code generation failed | Always | ❌ No - Must fix |\n| **Drift Warning** | Generated ≠ committed files | Based on `fail-on-drift` | ✅ Yes |\n\n### Decision Matrix\n\n```\n┌─────────────────────┬──────────────────┬──────────────┐\n│ Condition           │ fail-on-drift    │ Result       │\n├─────────────────────┼──────────────────┼──────────────┤\n│ Validation error    │ true/false       │ ❌ FAIL      │\n│ Generation error    │ true/false       │ ❌ FAIL      │\n│ Drift detected      │ true             │ ❌ FAIL      │\n│ Drift detected      │ false            │ ⚠️  WARN     │\n│ No drift            │ true/false       │ ✅ PASS      │\n└─────────────────────┴──────────────────┴──────────────┘\n```\n\n### Validation Errors (Always Fail)\n\n**Cause:** Syntax errors, undefined types, invalid attributes in `.lumos` files\n\n**Symptoms:**\n- `schemas-validated: 0` in outputs\n- Error messages in logs: \"expected `struct`\", \"undefined type\", etc.\n\n**Fix:**\n```bash\n# Validate locally\nlumos validate schemas/**/*.lumos\n\n# Check for errors\nlumos check schemas/**/*.lumos\n```\n\n### Generation Errors (Always Fail)\n\n**Cause:** Code generator encountered an error\n\n**Symptoms:**\n- `schemas-generated: 0` in outputs\n- Schemas validated successfully, but generation failed\n\n**Fix:**\n- Check LUMOS CLI version compatibility\n- Review generated code requirements\n- Check for unsupported features in schemas\n\n### Drift Warnings (Configurable)\n\n**Cause:** Generated code differs from committed files\n\n**Symptoms:**\n- `drift-detected: true` in outputs\n- Schemas validated and generated successfully\n- Git diff shows changes in `generated.rs` / `generated.ts`\n\n**Fix:**\n```bash\n# Regenerate code\nlumos generate schemas/**/*.lumos\n\n# Commit changes\ngit add generated.rs generated.ts\ngit commit -m \"Update generated code from schemas\"\n```\n\n**Control behavior:**\n```yaml\n# Fail on drift (strict - blocks PRs)\nfail-on-drift: true\n\n# Warn only (lenient - allows auto-commit)\nfail-on-drift: false\n```\n\n### Output Reference\n\n| Output | Type | Description | Example |\n|--------|------|-------------|---------|\n| `schemas-validated` | number | Count of validated schemas | `3` |\n| `schemas-generated` | number | Count of generated schemas | `3` |\n| `drift-detected` | boolean | Whether drift exists | `true` / `false` |\n| `diff-summary` | string | Markdown-formatted diff | See format above |\n\n### Common Error Messages\n\n**\"Schema validation failed\"**\n- **Type:** Validation Error\n- **Action:** Fix syntax in `.lumos` files\n\n**\"Code generation failed\"**\n- **Type:** Generation Error\n- **Action:** Check generator compatibility, review CLI version\n\n**\"Drift detected and fail-on-drift is enabled\"**\n- **Type:** Drift Warning (configured to fail)\n- **Action:** Regenerate code or set `fail-on-drift: false`\n\nSee [examples/workflows/error-handling.yml](examples/workflows/error-handling.yml) for handling strategies.\n\n## Troubleshooting\n\n### Drift Always Detected\n\n**Problem:** Drift detected even when files should match\n\n**Causes:**\n1. Line ending differences (CRLF vs LF)\n2. Inconsistent rustfmt versions\n3. Trailing whitespace differences\n4. Generated code version mismatch\n\n**Solutions:**\n```yaml\n# 1. Normalize line endings in .gitattributes\n*.rs text eol=lf\n*.ts text eol=lf\n\n# 2. Pin LUMOS CLI version\n- uses: getlumos/lumos-action@v1\n  with:\n    version: '0.1.1'  # Specific version\n\n# 3. Format generated files consistently\n- run: |\n    cargo fmt\n    git add generated.rs\n```\n\n### Installation Failures\n\n**Problem:** LUMOS CLI fails to install\n\n**Causes:**\n1. Version doesn't exist on crates.io\n2. Rust toolchain incompatibility\n3. Network connectivity issues\n4. Cargo cache corruption\n\n**Solutions:**\n```yaml\n# 1. Verify version exists\n- uses: getlumos/lumos-action@v1\n  with:\n    version: 'latest'  # Use latest stable\n\n# 2. Clear cargo cache (in workflow)\n- run: rm -rf ~/.cargo/registry/cache\n\n# 3. Use fallback version\n- uses: getlumos/lumos-action@v1\n  with:\n    version: '0.1.1'  # Known working version\n  continue-on-error: true\n```\n\n### PR Comments Not Appearing\n\n**Problem:** Expected PR comment doesn't appear\n\n**Causes:**\n1. Not running in PR context\n2. `comment-on-pr: false` set\n3. Insufficient permissions\n4. Event type not `pull_request`\n\n**Solutions:**\n```yaml\n# 1. Check event type\non:\n  pull_request:  # Required for PR comments\n    branches: [main]\n\n# 2. Enable comments explicitly\n- uses: getlumos/lumos-action@v1\n  with:\n    comment-on-pr: true\n\n# 3. Grant write permissions\npermissions:\n  pull-requests: write\n  contents: read\n```\n\n### Output Parsing Issues\n\n**Problem:** Can't parse `diff-summary` output\n\n**Format:** The output is markdown with this structure:\n```markdown\n## 📊 LUMOS Generation Drift Detected\n\n- `file1.rs`\n- `file2.ts`\n\n\u003cdetails\u003e\n...\n\u003c/details\u003e\n```\n\n**Parse files:**\n```javascript\nconst diffSummary = `${{ steps.lumos.outputs.diff-summary }}`;\nconst files = [...diffSummary.matchAll(/`([^`]+\\.(rs|ts))`/g)]\n  .map(m =\u003e m[1]);\n```\n\n**Parse sections:**\n```javascript\nconst hasDetails = diffSummary.includes('\u003cdetails\u003e');\nconst isDrift = diffSummary.includes('Drift Detected');\n```\n\nSee [examples/workflows/diff-parsing.yml](examples/workflows/diff-parsing.yml) for more parsing examples.\n\n### Permissions Errors\n\n**Problem:** \"Resource not accessible by integration\"\n\n**Cause:** Missing GitHub token permissions\n\n**Solution:**\n```yaml\npermissions:\n  contents: write      # For pushing commits\n  pull-requests: write # For PR comments\n  issues: write        # For issue comments\n\njobs:\n  generate:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write\n      pull-requests: write\n    steps:\n      - uses: getlumos/lumos-action@v1\n```\n\n### False Positive Drift\n\n**Problem:** Drift detected on first run after setup\n\n**Cause:** Generated files never committed initially\n\n**Solution:**\n```bash\n# Initial setup - generate and commit\nlumos generate schemas/**/*.lumos\ngit add generated.rs generated.ts\ngit commit -m \"Initial generated code\"\ngit push\n\n# Now CI will compare against this baseline\n```\n\n## Versioning\n\nThis action uses semantic versioning. You can reference it in several ways:\n\n- `getlumos/lumos-action@v1` - Latest v1.x release (recommended)\n- `getlumos/lumos-action@v1.0.0` - Specific version\n- `getlumos/lumos-action@main` - Latest commit (not recommended for production)\n\n## License\n\nLicensed under either of Apache License, Version 2.0 or MIT license at your option.\n\n## Support\n\n- Documentation: https://lumos-lang.org/tools/github-action\n- Issues: https://github.com/getlumos/lumos/issues\n- Discussions: https://github.com/getlumos/lumos/discussions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetlumos%2Flumos-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetlumos%2Flumos-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetlumos%2Flumos-action/lists"}