Skip to content

GitHub Action ​

Fails the pull request when a barcode in the artwork is under size, low in contrast, short of clear space or breaks a GS1 rule. The report goes in the job summary and each problem is an annotation on its file.

yaml
name: Barcodes
on:
  pull_request:
    paths: ["artwork/**"]
permissions:
  contents: read
jobs:
  barcodes:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: trulyfinal/barcode-grader@v0
        with:
          files: artwork/**/*.pdf

Inputs ​

inputdefaultwhat it does
filesrequiredfiles, folders or patterns, one per line
fail-onfailfail, check (also anything worth a look) or never
min-gradeGS1's own minimumlowest predicted grade to accept: A, B, C, D
processnoneflexo, offset, gravure, digital
allow-emptytruewhether a file without any barcode is fine
versionlatestthe npm version to run; pin it so a release can't change your results
sariffalsealso write a SARIF report
summarytrueadd the report to the job summary
working-directory.where to run

Outputs ​

codes, failed, checks, json-file, sarif-file, set when the step passes. When it fails the job, GitHub drops a composite action's outputs; the report is still in the job summary, each problem is an annotation, and with sarif: true the SARIF file is at barcode-grader.sarif in the working directory.

Code scanning ​

yaml
      - id: barcodes
        uses: trulyfinal/barcode-grader@v0
        with:
          files: artwork/**/*.pdf
          sarif: true
      - uses: github/codeql-action/upload-sarif@v3
        if: always() && hashFiles('barcode-grader.sarif') != ''
        with:
          sarif_file: barcode-grader.sarif

The job needs security-events: write. Ready-to-copy workflows are in examples/ci.

MIT licensed. It predicts from the artwork; it is not a verifier.