Skip to content

GitHub Actions

PromptLint has a dedicated GitHub Action on the Marketplace: AryaanSheth/promptlint@v1.

Basic Usage

yaml
# .github/workflows/lint-prompts.yml
name: Lint Prompts

on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: AryaanSheth/promptlint@v1
        with:
          path: prompts/

Inputs

InputDefaultDescription
pathprompts/Directory or glob to scan
promptInline prompt text (alternative to path)
fail-levelcriticalMinimum severity for failure: critical, warn, info, none
config.promptlintrcConfig file path
show-scorefalseDisplay score/grade in workflow summary
sarif-outputfalseUpload SARIF to GitHub Security tab
annotationstrueAdd inline PR annotations for findings

Outputs

OutputDescription
findings-countTotal number of findings
critical-countNumber of CRITICAL findings
scorePrompt quality score (0–100)
gradeLetter grade (A–F)

Common Configurations

Strict — fail on warnings

yaml
- uses: AryaanSheth/promptlint@v1
  with:
    path: prompts/
    fail-level: warn
    show-score: true

Security scan with SARIF upload

yaml
- uses: AryaanSheth/promptlint@v1
  with:
    path: prompts/
    fail-level: critical
    sarif-output: true

This uploads findings to the SecurityCode scanning tab.

Use score in downstream steps

yaml
- uses: AryaanSheth/promptlint@v1
  id: promptlint
  with:
    path: prompts/

- name: Comment score on PR
  if: github.event_name == 'pull_request'
  uses: actions/github-script@v7
  with:
    script: |
      github.rest.issues.createComment({
        ...context.repo,
        issue_number: context.issue.number,
        body: `PromptLint score: **${{ steps.promptlint.outputs.score }}/100** (${{ steps.promptlint.outputs.grade }})`
      })

Custom config per environment

yaml
- uses: AryaanSheth/promptlint@v1
  with:
    path: prompts/
    config: .promptlintrc.ci      # stricter config for CI
    fail-level: warn

Scan inline prompt

yaml
- uses: AryaanSheth/promptlint@v1
  with:
    prompt: |
      You are a helpful assistant.
      Answer questions about our product.
    fail-level: warn

Full Workflow Example

yaml
name: Prompt Quality Gate

on:
  pull_request:
    paths:
      - 'prompts/**'
      - '.promptlintrc'

jobs:
  lint:
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      pull-requests: write

    steps:
      - uses: actions/checkout@v4

      - name: Lint prompts
        uses: AryaanSheth/promptlint@v1
        id: lint
        with:
          path: prompts/
          fail-level: warn
          sarif-output: true
          show-score: true
          annotations: true

      - name: PR comment
        if: always() && github.event_name == 'pull_request'
        uses: actions/github-script@v7
        with:
          script: |
            const score = '${{ steps.lint.outputs.score }}';
            const grade = '${{ steps.lint.outputs.grade }}';
            const count = '${{ steps.lint.outputs.findings-count }}';
            const critical = '${{ steps.lint.outputs.critical-count }}';
            const emoji = grade === 'A' ? '✅' : grade <= 'C' ? '⚠️' : '❌';
            github.rest.issues.createComment({
              ...context.repo,
              issue_number: context.issue.number,
              body: `${emoji} **PromptLint**: ${score}/100 (${grade}) · ${count} findings (${critical} critical)`
            });

Released under the Apache 2.0 License.