Run architecture conformance rules against changed files in your CI pipeline. Annotates violations directly on pull requests and blocks merges when rules are violated.
on:
pull_request:
branches: [main]
jobs:
conformance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: archyl-com/actions/conformance-check@v1
with:
api-key: ${{ secrets.ARCHYL_API_KEY }}
organization-id: ${{ secrets.ARCHYL_ORG_ID }}
project-id: 'your-project-uuid'- uses: archyl-com/actions/conformance-check@v1
with:
api-key: ${{ secrets.ARCHYL_API_KEY }}
organization-id: ${{ secrets.ARCHYL_ORG_ID }}
project-id: 'your-project-uuid'
fail-on: 'error' # Fail on error-level violations only (default)- uses: archyl-com/actions/conformance-check@v1
with:
api-key: ${{ secrets.ARCHYL_API_KEY }}
organization-id: ${{ secrets.ARCHYL_ORG_ID }}
project-id: 'your-project-uuid'
fail-on: 'warning'- uses: archyl-com/actions/conformance-check@v1
with:
api-key: ${{ secrets.ARCHYL_API_KEY }}
organization-id: ${{ secrets.ARCHYL_ORG_ID }}
project-id: 'your-project-uuid'
fail-on: 'none'- uses: archyl-com/actions/conformance-check@v1
with:
api-key: ${{ secrets.ARCHYL_API_KEY }}
organization-id: ${{ secrets.ARCHYL_ORG_ID }}
project-id: 'your-project-uuid'
comment-on-pr: 'false'jobs:
architecture:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Conformance check
uses: archyl-com/actions/conformance-check@v1
with:
api-key: ${{ secrets.ARCHYL_API_KEY }}
organization-id: ${{ secrets.ARCHYL_ORG_ID }}
project-id: 'your-project-uuid'
- name: Drift score
uses: archyl-com/actions/drift-score@v1
with:
api-key: ${{ secrets.ARCHYL_API_KEY }}
organization-id: ${{ secrets.ARCHYL_ORG_ID }}
project-id: 'your-project-uuid'
threshold: '70'- Detects changed files from the pull request or push event via the GitHub API
- Reads file contents (first 200 lines per file — imports, types, signatures)
- Sends to Archyl in chunks of 20 files for conformance rule evaluation
- Creates annotations on the exact files where violations occur
- Comments on the PR with a summary table of all violations
- Fails the check if violations exceed the configured severity threshold
| Input | Required | Default | Description |
|---|---|---|---|
api-key |
Yes | Archyl API key with write scope | |
organization-id |
Yes | Archyl organization UUID | |
project-id |
Yes | Archyl project UUID | |
api-url |
No | https://api.archyl.com |
API base URL (for self-hosted) |
fail-on |
No | error |
Minimum severity that fails: error, warning, or none |
comment-on-pr |
No | true |
Post a summary comment on the PR |
github-token |
No | ${{ github.token }} |
Token for PR comments and file listing |
max-file-lines |
No | 200 |
Max lines to send per file (reduces token usage) |
chunk-size |
No | 20 |
Files per API call (for large diffs) |
| Output | Description |
|---|---|
check-id |
UUID of the conformance check |
total-violations |
Total violations found |
errors |
Error-level violations |
warnings |
Warning-level violations |
infos |
Info-level violations |
status |
pass or fail |
The action posts (or updates) a comment on the pull request with a table of violations:
| Severity | Rule | File | Message |
|---|---|---|---|
| 🔴 error | No Direct DB Access | handlers/user.go |
Handler directly imports database package |
| 🟠 warning | OpenAPI Required | services/payment.go |
Service has no linked API contract |
Violations are also shown as GitHub annotations directly on the changed files in the PR diff, making it easy to see exactly where the architecture rules are violated.
A detailed summary is written to the GitHub Actions job summary with the full violation report.