Skip to main content

check-python-package.yml

Bundles the standard check suite for Python package repositories. Replaces individual workflow files with a single composite action or reusable workflow call.

What it runs

Runs the full Morrison-Lab repository hygiene pass plus Python package checks:

  • check-junk-files.yml: OS and editor detritus (.DS_Store, Thumbs.db, __pycache__, etc.)
  • check-secrets.yml: Gitleaks scan of git history for committed credentials and tokens
  • check-non-standard-chars.yml: flags non-standard unicode characters, curly quotes, and smart dashes
  • check-new-line-breaks.yml: enforces semantic line breaks on modified lines in diffs
  • check-typos.yml: crate-ci/typos CLI scan for spelling errors on modified files
  • lint-yaml.yml: yamllint over tracked YAML files
  • lint-workflows.yml: actionlint and zizmor over GitHub Actions workflows
  • lint-markdown.yml: markdownlint-cli2 over tracked Markdown files
  • Python linting: runs ruff check on the codebase
  • Python formatting: runs ruff format --check to enforce consistent formatting
  • Python tests: executes pytest when a tests/ or test/ directory is present

Every check is enabled by default. Opt out of any specific check by passing its boolean flag as false.

Inputs

Input Type Default Description
fail boolean true Fail the job on findings (else warn only).
python-version string '3.x' Python version to set up.
check-junk-files boolean true Enable junk files check.
junk-patterns string see check-junk-files.qmd Gitignore patterns naming junk files.
junk-paths-ignore string '' Paths to exempt from junk files scan.
check-secrets boolean true Enable gitleaks secrets scan.
secrets-config string '' Custom gitleaks config file path.
secrets-paths-ignore string '' Regex paths to exempt from secrets scan.
check-non-standard-chars boolean true Enable non-standard character check.
non-standard-chars-extensions string '.py, .qmd, .md' File extensions to check for non-standard characters.
check-new-line-breaks boolean true Enable semantic line break check.
new-line-breaks-base-ref string '' Base ref for diff-scoping new line breaks.
new-line-breaks-globs string '' Globs to check for new line breaks.
check-typos boolean true Enable typos check.
typos-config string '' Typos configuration file path.
typos-base-ref string '' Base ref for diff-scoping typo checks.
lint-yaml boolean true Enable YAML linting.
yaml-config-file string '' Custom yamllint config file path.
yaml-paths-ignore string '' Patterns to exclude from YAML linting.
lint-workflows boolean true Enable workflow linting.
workflows-path string '.' Path to workflow files.
lint-markdown boolean true Enable Markdown linting.
markdown-config-file string '' Markdownlint config file path.
markdown-globs string '*.md' Git pathspecs of Markdown files to lint.
markdown-paths-ignore string '' Paths to exempt from Markdown linting.
markdown-base-ref string '' Base ref for list-item splice checks.
check-ruff boolean true Enable Ruff linting.
check-formatting boolean true Enable Ruff formatting check.
ruff-args string '' Additional arguments for Ruff.
check-tests boolean true Run pytest if tests/ exists.
pytest-args string '-v' Additional arguments for pytest.

Example

name: Check Python package

on:
  push:
    branches: [main]
  pull_request:

jobs:
  check:
    permissions:
      contents: read
    uses: Morrison-Lab/gha/.github/workflows/check-python-package.yml@v3