Skip to content

ci: skip CI on docs-only changes via paths-ignore#105

Merged
martinkersner merged 1 commit into
mainfrom
issue-104-skip-ci-docs-only
Jun 30, 2026
Merged

ci: skip CI on docs-only changes via paths-ignore#105
martinkersner merged 1 commit into
mainfrom
issue-104-skip-ci-docs-only

Conversation

@martinkersner

Copy link
Copy Markdown
Member

Summary

Adds a paths-ignore filter to the push trigger in .github/workflows/python-package.yml so pushes that touch only docs/markdown/LICENSE/.gitignore skip the workflow. Any change to code, tests, requirements, or the workflow file itself still runs the full 5-version matrix (3.10–3.14).

on:
  push:
    paths-ignore:
      - '**.md'
      - 'docs/**'
      - 'LICENSE'
      - '.gitignore'

The build job, matrix, and all steps are unchanged — only the trigger block was modified.

Rationale: paths-ignore (blocklist) vs paths (allowlist)

paths-ignore fails safe: any new or unanticipated code path still triggers CI. A paths allowlist would silently skip CI for any path someone forgot to add. The ignore list is deliberately limited to files that genuinely cannot affect the lint checks (black/flake8 only run on .py): markdown, the docs/** tree (verified: only .md/css/images, no Python), LICENSE, and .gitignore.

Branch protection

main has no branch protection (verified: repos/Bisonai/datamaxi-python/branches/main/protection → 404), so a skipped workflow leaves no required-check pending. No no-op fallback job is needed; a plain paths-ignore filter is sufficient.

Test / validation plan

  • YAML validated with yaml.safe_load (parses OK).
  • Diff confirmed scoped: only the on: trigger block changed; job/matrix/steps untouched.
  • To confirm behavior after merge: a docs-only push (e.g. editing README.md) should not trigger python-package.yml; a push touching any .py/requirements/workflow file should still run the full matrix.

Closes #104

Add paths-ignore to the push trigger so pushes touching only docs/
markdown/LICENSE/.gitignore skip python-package.yml. Any code, test,
requirements, or workflow change still runs the full matrix.

Closes #104
@martinkersner martinkersner self-assigned this Jun 30, 2026
@martinkersner martinkersner merged commit a75b2b1 into main Jun 30, 2026
7 checks passed
@martinkersner martinkersner deleted the issue-104-skip-ci-docs-only branch June 30, 2026 05:26
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.

Skip CI when only docs/irrelevant files change

1 participant