Skip to content

Add composite GitHub Action - #9

Open
andrew wants to merge 2 commits into
mainfrom
github-action
Open

Add composite GitHub Action#9
andrew wants to merge 2 commits into
mainfrom
github-action

Conversation

@andrew

@andrew andrew commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Composite action at the repo root so users can reference git-pkgs/licenses@v0.

Downloads the release tarball for the runner OS/arch, verifies against checksums.txt, runs licenses -json, and applies an optional deny/allow policy over detected expression identifiers with jq. Denied expressions become ::error annotations on each file that carries them, and the job summary lists every expression with its identification state and file/match counts.

- uses: git-pkgs/licenses@v0
  with:
    deny: agpl-3.0,gpl-3.0,sspl-1.0

Inputs: version, path, scope, max-files, skip, deny, allow, fail-on-no-detections. Outputs: report (path to the JSON), expressions, denied.

.github/workflows/action.yml self-tests on ubuntu and macos runners: asserts MIT is detected with a schema-1 report, and asserts a deny: mit run fails.

README docs to follow once the concurrent docs/benchmarking.md change lands, to avoid a merge conflict on the Benchmarks section.

andrew added 2 commits July 30, 2026 14:10
Downloads the release binary for the runner platform, verifies it
against checksums.txt, runs a JSON scan, and applies an optional
allow/deny policy over detected expression identifiers with jq. Denied
expressions produce ::error annotations at each file that carries them.
The job summary lists every expression with identification, file count,
and match count.

Inputs: version, path, scope, max-files, skip, deny, allow,
fail-on-no-detections. Outputs: report path, expressions,
denied expressions.

.github/workflows/action.yml self-tests the action on this repository on
ubuntu-latest and macos-latest, asserts MIT is detected and the report
is well-formed, and asserts a deny:mit run fails.
The repository's own test fixtures contain AGPL-3.0 string literals that
the scanner detects, so denying it fails the self-test. The deny-fails
job already exercises the policy path.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a composite GitHub Action at the repository root so consumers can run git-pkgs/licenses@v0 to download the appropriate licenses release binary, generate a JSON scan report, apply optional allow/deny policy checks, and emit annotations + a GitHub Actions job summary.

Changes:

  • Introduces action.yml composite action that installs the licenses CLI from GitHub releases, verifies checksums.txt, runs licenses -json, and applies deny/allow policy logic via jq.
  • Emits outputs (report, expressions, denied) and writes a markdown summary, failing the job when policy violations occur and optionally when no detections are found.
  • Adds .github/workflows/action.yml self-test workflow (ubuntu + macOS) to validate baseline detection and policy-failure behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
action.yml New composite action that installs licenses, runs scans, applies policy, and produces outputs/summary.
.github/workflows/action.yml CI workflow that exercises the composite action on ubuntu and macOS and asserts expected outputs/failure modes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread action.yml
echo "::error::no checksum for ${asset} in checksums.txt"
exit 1
fi
got=$(sha256sum "${dest}/${asset}" | awk '{print $1}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants