Skip to content

Add PR Checks CI workflow (shellcheck, hadolint, compose-validate, markdown-lint) - #13

Merged
itscooleric merged 6 commits into
mainfrom
copilot/add-github-actions-workflow
Mar 3, 2026
Merged

itscooleric merged 6 commits into
mainfrom
copilot/add-github-actions-workflow

Conversation

Copilot AI commented Mar 3, 2026 •

Copy link
Copy Markdown
Contributor

No CI existed for this repo. This adds a lightweight GitHub Actions workflow that runs four linting/validation jobs in parallel on every PR targeting main.

Workflow: .github/workflows/pr-checks.yml

  • shellcheck — lints clide and entrypoint.sh via ludeeus/action-shellcheck@master
  • hadolint — enforces Dockerfile best practices via hadolint/hadolint-action@v3.1.0
  • compose-validate — validates docker-compose.yml with docker compose config --quiet
  • markdown-lint — lints Markdown docs via DavidAnson/markdownlint-cli2-action@v19

All jobs run in parallel on ubuntu-latest with no inter-job dependencies. A top-level permissions: contents: read block is included to enforce least-privilege on GITHUB_TOKEN.

Original prompt

Add a GitHub Actions workflow at .github/workflows/pr-checks.yml that runs lightweight, fast checks on every pull request targeting main. The repo is Shell-based with a Dockerfile, docker-compose.yml, Makefile, and Markdown docs. There are currently no CI workflows.

The workflow should contain the following four jobs, all running in parallel on ubuntu-latest:

1. ShellCheck — Lint shell scripts

Catches bugs, quoting issues, and bad practices in shell scripts (clide, entrypoint.sh).

shellcheck:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - uses: ludeeus/action-shellcheck@master

2. Hadolint — Lint the Dockerfile

Enforces Dockerfile best practices (relevant to upcoming security hardening issues like non-root user, dependency pinning, healthcheck).

hadolint:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - uses: hadolint/hadolint-action@v3.1.0

3. Docker Compose Validate — Validate compose files

Ensures docker-compose.yml stays syntactically valid as hardening options are added.

compose-validate:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - run: docker compose config --quiet

4. Markdown Lint — Validate documentation

Keeps Markdown files clean as new documentation is added (architecture diagram, runbook, compatibility matrix, threat model).

markdown-lint:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - uses: DavidAnson/markdownlint-cli2-action@v19

Full workflow trigger:

name: PR Checks
on:
  pull_request:
    branches: [main]

All four jobs should run in parallel (no dependencies between them). This keeps the total CI time under 15 seconds on the free GitHub Actions tier.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: itscooleric <25490177+itscooleric@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions workflow for PR checks Add PR Checks CI workflow (shellcheck, hadolint, compose-validate, markdown-lint) Mar 3, 2026
itscooleric and others added 4 commits March 3, 2026 19:38
- setup_lts.x → setup_22.x (prevents surprise LTS major jumps)
- ttyd /latest/ → pinned 1.7.7 (current stable)
- Replace wget with curl throughout (DL4001)
- Add --no-install-recommends to all apt-get install (DL3015)
- Add SHELL pipefail before pipe commands (DL4006)
- Add .hadolint.yaml ignoring DL3008/DL3016 (npm/apt tools intentionally unpinned)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Dockerfile: quote $(uname -m) via ARCH variable to fix SC2046
- Workflow: add config: .hadolint.yaml so hadolint picks up ignore rules
- Workflow: cp .env.example .env before compose-validate to provide env file
- Add .markdownlint.yaml: disable MD013/022/031/032 (style-only rules)
- DEPLOY.md: remove stray closing fence with no matching open

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Workflow: add ignore: DL3008 DL3016 to hadolint step (config file
  path wasn't being resolved correctly inside the action container)
- README.md: add language specifier to env code fences (MD040)
- .markdownlint.yaml: disable MD034 (bare URLs in technical docs)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The hadolint-action ignore input and .hadolint.yaml config file were not
being applied. Inline directives are the most reliable approach.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@itscooleric
itscooleric marked this pull request as ready for review March 3, 2026 21:54
@itscooleric
itscooleric merged commit 9e24662 into main Mar 3, 2026
4 checks passed
@itscooleric
itscooleric deleted the copilot/add-github-actions-workflow branch March 3, 2026 22:06
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