Skip to content

feat: add GitHub Action and Docker support - #72

Open
pixincreate wants to merge 12 commits into
feat/missing-featuresfrom
feat/github-action-docker
Open

feat: add GitHub Action and Docker support#72
pixincreate wants to merge 12 commits into
feat/missing-featuresfrom
feat/github-action-docker

Conversation

@pixincreate

Copy link
Copy Markdown
Owner

Summary

Adds the infrastructure for running KeyWatch in CI/CD environments.

Changes

GitHub Action (.github/actions/keywatch-scan/action.yml)

Composite action that installs and runs key-watch with configurable inputs:

  • paths - files or directories to scan (default: .)
  • exit-mode - strict (default), critical, or always
  • output - path for JSON report
  • verbose - detailed console output
  • Downloads binary from GitHub releases if not pre-installed
  • Exposes findings-count and exit-code outputs
  • Writes summary step to $GITHUB_STEP_SUMMARY

Dockerfile

Multi-stage build:

  • Build: rust:1.85-alpine with musl target
  • Runtime: alpine:3.21 with ca-certificates
  • Bundles detectors.toml at /etc/keywatch/detectors.toml
  • Respects KEYWATCH_CONFIG_PATH env var

Docker Publish Workflow

  • Triggered on `v*' version tags or manual dispatch
  • Builds and pushes to ghcr.io/pixincreate/keywatch
  • Tags: semver (1.2.0, 1.2), short SHA

Usage

- uses: pixincreate/KeyWatch/.github/actions/keywatch-scan@master
  with:
    paths: './src'
    exit-mode: 'critical'
docker run ghcr.io/pixincreate/keywatch:latest scan /workspace

Closes the Action and Docker items from #71.

- .github/actions/keywatch-scan/action.yml: composite action that downloads
  and runs key-watch on specified paths with configurable exit mode
- Dockerfile: multi-stage build (rust:alpine → alpine:3.21 runtime)
- .dockerignore: exclude build artifacts and non-essential files
- .github/workflows/docker-publish.yml: build & push to GHCR on version tags
@pixincreate
pixincreate changed the base branch from master to feat/missing-features July 30, 2026 16:32
@pixincreate
pixincreate force-pushed the feat/github-action-docker branch from f15a9b6 to 2e62f03 Compare July 30, 2026 16:32
…/github-action-docker

* origin/feat/missing-features:
  docs(changelog): add PR review fix entries
  chore(deps): bump toml from 1.1.3+spec-1.1.0 to 1.1.4+spec-1.1.0 (#70)

# Conflicts:
#	CHANGELOG.md
…to scratch

- docker-publish.yml: actions/checkout v4→v7, login-action v3→v4.6.0,
  metadata-action v5→v6.2.0, build-push-action v6→v7.3.0
- ci.yml, release.yml: actions/checkout v4→v7
- Dockerfile: runtime stage alpine→scratch (static musl binary),
  numeric USER 65532:65532, absolute ENTRYPOINT path
…/github-action-docker

* origin/feat/missing-features:
  refactor: use const for baseline version and domain separator, rename severity param
- Dockerfile: install git + ca-certificates on alpine:3.23 runtime so
  --git-history scanning and hook installation work in the container
- Dockerfile: copy templates/ (build was missing them, failed at compile)
- Dockerfile: bump build stage to rust:1.97.1-alpine (let-chains in
  scanner.rs require rust >= 1.88)
- ci.yml: crate-ci/typos master -> v1.48.0, Swatinem/rust-cache v2.7.0 -> v2.9.1
- release.yml: softprops/action-gh-release v1 -> v3.0.2

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.

🟡 Not ready to approve

The new composite action and Docker publish workflow contain functional issues (verbose flag always enabled, platform/asset resolution and install assumptions, and an unused workflow_dispatch input) that can break CI/CD usage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Adds CI/CD infrastructure for KeyWatch by introducing a composite GitHub Action for scanning, a multi-stage Docker image build, and a GHCR publish workflow, plus workflow/version updates and documentation entries.

Changes:

  • Added a composite GitHub Action (.github/actions/keywatch-scan/action.yml) to install and run key-watch with configurable inputs and outputs.
  • Added container support via a multi-stage Dockerfile and a new .dockerignore.
  • Added a Docker publish workflow to push images to GHCR; updated existing CI/release workflows to newer action versions.
File summaries
File Description
Dockerfile Adds multi-stage build/runtime containerization for key-watch and bundles detectors.toml.
CHANGELOG.md Documents the new GitHub Action and Docker-related additions/changes.
.github/workflows/release.yml Updates action versions used in the release pipeline.
.github/workflows/docker-publish.yml Introduces GHCR Docker image build/publish workflow on tags/manual dispatch.
.github/workflows/ci.yml Updates action versions used in CI (checkout, typos, rust-cache).
.github/actions/keywatch-scan/action.yml Introduces a composite Action to download/install key-watch and run scans with outputs/summary.
.dockerignore Optimizes Docker build context by excluding git metadata, build output, and misc files.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 6
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread .github/actions/keywatch-scan/action.yml Outdated
Comment thread .github/actions/keywatch-scan/action.yml Outdated
Comment thread .github/actions/keywatch-scan/action.yml Outdated
Comment thread Dockerfile Outdated
Comment thread Dockerfile Outdated
Comment thread .github/workflows/docker-publish.yml
…/github-action-docker

* origin/feat/missing-features:
  style: group Rust imports
  fix: harden generated git hooks
  fix: harden file and git history scanning
  fix: validate detector severity and names
  fix: stabilize baseline fingerprints
* feat/missing-features:
  fix: guard Unix-only hook test imports
@pixincreate
pixincreate force-pushed the feat/github-action-docker branch from 7e20919 to e543e6d Compare August 1, 2026 18:28
@pixincreate
pixincreate force-pushed the feat/github-action-docker branch from e543e6d to 699f621 Compare August 1, 2026 18:52
* feat/missing-features:
  style: use descriptive scanner test errors
  refactor: simplify baseline hashing
  refactor: clarify pre-push remote policy shell
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