Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}

permissions:
contents: read
Expand All @@ -13,10 +14,14 @@ permissions:

jobs:
# Detect whether the change touches any code-relevant path.
# Docs-only changes (README, *.md, *.csv, docs/**) skip heavy work
# while every required check name still reports success — this avoids
# the paths-ignore + required-status-checks deadlock that previously
# blocked docs-only PRs.
# Docs-only changes (README, *.md outside the repo root data files,
# docs/**) skip heavy work while every required check name still
# reports success — this avoids the paths-ignore + required-status-checks
# deadlock that previously blocked docs-only PRs.
#
# Data files bundled into the container image (tercet_missing_codes.csv,
# docker-entrypoint.sh) ARE code-relevant — a change to either affects
# what ships in `ghcr.io/.../:latest`, so they belong in the filter.
changes:
runs-on: ubuntu-latest
outputs:
Expand All @@ -36,6 +41,8 @@ jobs:
- 'pyproject.toml'
- 'Dockerfile'
- 'Makefile'
- 'docker-entrypoint.sh'
- 'tercet_missing_codes.csv'
- '.github/workflows/**'

lint:
Expand Down Expand Up @@ -126,7 +133,9 @@ jobs:
run: echo "Docs-only change — skipping docker build."

publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changes.outputs.code == 'true'
# workflow_dispatch on main always publishes (the whole point of a manual
# trigger); push to main publishes only if a code-relevant file changed.
if: github.ref == 'refs/heads/main' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && needs.changes.outputs.code == 'true'))
needs: [changes, lint, import-check, test, security, docker]
runs-on: ubuntu-latest
steps:
Expand Down
Loading