From 34fd19f08d645d5e23ddee5da931718f3d940e50 Mon Sep 17 00:00:00 2001 From: rtibblesbot Date: Fri, 25 Sep 2026 00:08:17 -0700 Subject: [PATCH] Replace fkirc/skip-duplicate-actions with paths-filter - check-docs.yml: native `paths:`; drop pre_job - check_migrations_sqlite.yml, tox.yml, pre-commit.yml: dorny/paths-filter detect job - pre-commit.yml: `every` + '!**/*.po', '!**/*.json' to keep nested-file ignores Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/check-docs.yml | 27 ++++++--------- .github/workflows/check_migrations_sqlite.yml | 25 +++++++++----- .github/workflows/pre-commit.yml | 21 ++++++++---- .github/workflows/tox.yml | 34 ++++++++++++------- 4 files changed, 64 insertions(+), 43 deletions(-) diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index 8dae7f0b..938d86e3 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -1,29 +1,24 @@ name: Docs -on: [push, pull_request] +on: + push: + paths: + - 'docs/**' + - 'pyproject.toml' + - 'uv.lock' + pull_request: + paths: + - 'docs/**' + - 'pyproject.toml' + - 'uv.lock' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: - pre_job: - name: Path match check - runs-on: ubuntu-latest - # Map a step output to a job output - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@master - with: - github_token: ${{ github.token }} - paths: '["docs/**", "pyproject.toml", "uv.lock"]' - docs: name: Checking docs build - needs: pre_job - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.3 diff --git a/.github/workflows/check_migrations_sqlite.yml b/.github/workflows/check_migrations_sqlite.yml index cddbb77b..d4d98127 100644 --- a/.github/workflows/check_migrations_sqlite.yml +++ b/.github/workflows/check_migrations_sqlite.yml @@ -10,20 +10,29 @@ jobs: pre_job: name: Path match check runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read # Map a step output to a job output outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} + migrations: ${{ steps.filter.outputs.migrations }} steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@master + # paths-filter needs a checkout to diff push events + - uses: actions/checkout@v6.0.3 + - id: filter + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 with: - github_token: ${{ github.token }} - paths: '["morango/migrations/*.py", ".github/workflows/check_migrations_sqlite.yml", "pyproject.toml", "uv.lock"]' + filters: | + migrations: + - 'morango/migrations/*.py' + - '.github/workflows/check_migrations_sqlite.yml' + - 'pyproject.toml' + - 'uv.lock' build: name: Build wheel needs: pre_job - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.migrations == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.3 @@ -46,13 +55,12 @@ jobs: migration_test: name: SQLite migration tests needs: [pre_job, build] - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.migrations == 'true' }} runs-on: ubuntu-latest container: image: python:3.7-buster steps: - name: Install build dependencies - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} run: | echo "deb http://archive.debian.org/debian-archive/debian/ buster main" > /etc/apt/sources.list echo "deb http://archive.debian.org/debian-archive/debian-security/ buster/updates main" >> /etc/apt/sources.list @@ -96,5 +104,4 @@ jobs: - name: Install dependencies run: pip install "$(find dist -name '*.whl' | head -n 1)" - name: Run migrations - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} run: python tests/testapp/manage.py migrate diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 3e95dc9e..ef1eed5f 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -16,20 +16,29 @@ jobs: pre_job: name: Path match check runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read # Map a step output to a job output outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} + lint: ${{ steps.filter.outputs.lint }} steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@master + # paths-filter needs a checkout to diff push events + - uses: actions/checkout@v6.0.3 + - id: filter + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 with: - github_token: ${{ github.token }} - paths_ignore: '["**.po", "**.json"]' + predicate-quantifier: every + # Not '!**.po': picomatch applies that negation at the repo root only. + filters: | + lint: + - '!**/*.po' + - '!**/*.json' linting: name: All file linting needs: pre_job - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.lint == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.3 diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 8b5797c9..26bd00e2 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -10,20 +10,30 @@ jobs: pre_job: name: Path match check runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read # Map a step output to a job output outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} + python: ${{ steps.filter.outputs.python }} steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@master + # paths-filter needs a checkout to diff push events + - uses: actions/checkout@v6.0.3 + - id: filter + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 with: - github_token: ${{ github.token }} - paths: '["**.py", ".github/workflows/tox.yml", "tox.ini", "pyproject.toml", "uv.lock"]' + filters: | + python: + - '**.py' + - '.github/workflows/tox.yml' + - 'tox.ini' + - 'pyproject.toml' + - 'uv.lock' build: name: Build wheel needs: pre_job - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.python == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.3 @@ -46,7 +56,7 @@ jobs: unit_test: name: Python unit tests needs: [pre_job, build] - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.python == 'true' }} runs-on: ubuntu-latest strategy: max-parallel: 5 @@ -73,7 +83,7 @@ jobs: unit_test_eol_python: name: Python unit tests for EOL Python versions needs: [pre_job, build] - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.python == 'true' }} runs-on: ubuntu-latest strategy: max-parallel: 5 @@ -110,7 +120,7 @@ jobs: cryptography: name: Python unit tests + cryptography needs: [pre_job, build] - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.python == 'true' }} runs-on: ubuntu-latest env: cryptography_version: '40.0.2' @@ -142,7 +152,7 @@ jobs: cryptography_eol_python: name: Python unit tests + cryptography for EOL Python versions needs: [pre_job, build] - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.python == 'true' }} runs-on: ubuntu-latest env: cryptography_version: '40.0.2' @@ -188,7 +198,7 @@ jobs: postgres: name: Python postgres unit tests needs: [pre_job, build] - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.python == 'true' }} runs-on: ubuntu-latest services: # Label used to access the service container @@ -227,7 +237,7 @@ jobs: windows: name: Python unit tests on Windows Server needs: [pre_job, build] - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + if: ${{ needs.pre_job.outputs.python == 'true' }} runs-on: windows-latest strategy: max-parallel: 5