Skip to content

Commit b5c562d

Browse files
wyddy7claude
andauthored
ci(deploy): run the lint gate on pull requests, not only on push (#2)
The workflow triggered on `push` to master/org only, so the `lint` (flake8) gate never ran on pull requests. Combined with branch protection that requires a PR but had no required status check, code could be merged through a PR with zero CI validation. Add a `pull_request` trigger (base master/org) so `lint` runs on PRs and becomes a status check that branch protection can require. Build/push and deploy are guarded with `if: github.event_name == 'push'` so they stay push-only — a PR must never build an image or deploy to homelab. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b0a0074 commit b5c562d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Deploy to Homelab
33
on:
44
push:
55
branches: [ "master", "org" ]
6+
# Run the lint gate on PRs too, so code is validated BEFORE it merges
7+
# (branch protection requires a PR but had no status check to enforce).
8+
# Build/deploy stay push-only — see the `if:` guards on those jobs.
9+
pull_request:
10+
branches: [ "master", "org" ]
611

712
env:
813
REGISTRY: ghcr.io
@@ -43,6 +48,9 @@ jobs:
4348
# ------------------------------------------------------------------
4449
build-and-push:
4550
needs: lint
51+
# Never build/push from a pull_request event — only on push to a deploy
52+
# branch. On PRs this job (and deploy below) is skipped; lint still runs.
53+
if: github.event_name == 'push'
4654
runs-on: ubuntu-latest
4755
permissions:
4856
contents: read
@@ -86,6 +94,7 @@ jobs:
8694
# ------------------------------------------------------------------
8795
deploy:
8896
needs: build-and-push
97+
if: github.event_name == 'push'
8998
runs-on: ubuntu-latest
9099
steps:
91100
- name: Connect to Tailscale

0 commit comments

Comments
 (0)