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/**/*.pdfInputs
| input | default | what it does |
|---|---|---|
files | required | files, folders or patterns, one per line |
fail-on | fail | fail, check (also anything worth a look) or never |
min-grade | GS1's own minimum | lowest predicted grade to accept: A, B, C, D |
process | none | flexo, offset, gravure, digital |
allow-empty | true | whether a file without any barcode is fine |
version | latest | the npm version to run; pin it so a release can't change your results |
sarif | false | also write a SARIF report |
summary | true | add 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.sarifThe job needs security-events: write. Ready-to-copy workflows are in examples/ci.