Skip to content

CI Integration

.github/workflows/repotype.yml
name: Repotype
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npx repotype validate . --json
.gitlab-ci.yml
repotype:
image: node:20
stage: test
script:
- npm install
- npx repotype validate . --json
artifacts:
when: always
paths:
- .repotype/
reports:
codequality: .repotype/compliance.json
.circleci/config.yml
version: 2.1
jobs:
repotype:
docker:
- image: cimg/node:20.0
steps:
- checkout
- run: npm install
- run: npx repotype validate . --json
- store_artifacts:
path: .repotype/
workflows:
validate:
jobs:
- repotype
CodeMeaning
0All validations passed
1One or more errors found
2Configuration error

For automated PR comments with validation results, use the JSON output:

- name: Validate and comment
run: |
npx repotype validate . --json > validation.json
# Use gh cli or another tool to post results as PR comment

Speed up CI by caching node_modules:

- uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

Require Repotype validation to pass before merging:

  1. Go to Settings → Branches → Branch protection rules
  2. Add rule for main
  3. Enable “Require status checks to pass”
  4. Select the repotype job

Now PRs must pass validation before merge.