From 3e340b0abcf9f6a48851e87780ef0deba7d48100 Mon Sep 17 00:00:00 2001 From: Javid Ahmed Date: Fri, 6 Mar 2026 22:07:51 +0000 Subject: [PATCH] Refactor conditionals in action workflows to remove unnecessary syntax --- .github/actions/build/build-wheel/action.yml | 4 +-- .../actions/build/verify-structure/action.yml | 4 +-- .github/actions/ci/bandit/action.yml | 4 +-- .github/actions/ci/mypy/action.yml | 4 +-- .github/actions/ci/pip-audit/action.yml | 4 +-- .github/actions/ci/pytest/action.yml | 4 +-- .github/actions/ci/ruff/action.yml | 4 +-- .../actions/ci/validate-pyproject/action.yml | 4 +-- .github/actions/ci/version-check/action.yml | 4 +-- .../setup/install-python-core/action.yml | 4 +-- .../setup/install-python-dev/action.yml | 4 +-- .github/workflows/build.yml | 8 +++--- .github/workflows/ci.yml | 28 +++++++++---------- 13 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/actions/build/build-wheel/action.yml b/.github/actions/build/build-wheel/action.yml index 7854994..eda09f2 100644 --- a/.github/actions/build/build-wheel/action.yml +++ b/.github/actions/build/build-wheel/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-core - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-core@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Create wheel run: | diff --git a/.github/actions/build/verify-structure/action.yml b/.github/actions/build/verify-structure/action.yml index 31e509e..2819041 100644 --- a/.github/actions/build/verify-structure/action.yml +++ b/.github/actions/build/verify-structure/action.yml @@ -16,9 +16,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-core - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-core@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Download wheel artifact uses: actions/download-artifact@v7 diff --git a/.github/actions/ci/bandit/action.yml b/.github/actions/ci/bandit/action.yml index 6bbb76a..0abdc54 100644 --- a/.github/actions/ci/bandit/action.yml +++ b/.github/actions/ci/bandit/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-dev - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-dev@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Security check run: | diff --git a/.github/actions/ci/mypy/action.yml b/.github/actions/ci/mypy/action.yml index 18b3162..3fe6389 100644 --- a/.github/actions/ci/mypy/action.yml +++ b/.github/actions/ci/mypy/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-dev - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-dev@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Check with mypy run: | diff --git a/.github/actions/ci/pip-audit/action.yml b/.github/actions/ci/pip-audit/action.yml index 0844e10..4a3237e 100644 --- a/.github/actions/ci/pip-audit/action.yml +++ b/.github/actions/ci/pip-audit/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-dev - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-dev@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Audit dependencies run: | diff --git a/.github/actions/ci/pytest/action.yml b/.github/actions/ci/pytest/action.yml index 4add27b..a11b1b1 100644 --- a/.github/actions/ci/pytest/action.yml +++ b/.github/actions/ci/pytest/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-dev - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-dev@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Test with pytest run: | diff --git a/.github/actions/ci/ruff/action.yml b/.github/actions/ci/ruff/action.yml index d44e7fc..6c8dacd 100644 --- a/.github/actions/ci/ruff/action.yml +++ b/.github/actions/ci/ruff/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-dev - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-dev@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Check with ruff run: | diff --git a/.github/actions/ci/validate-pyproject/action.yml b/.github/actions/ci/validate-pyproject/action.yml index 214bc7f..f0021d0 100644 --- a/.github/actions/ci/validate-pyproject/action.yml +++ b/.github/actions/ci/validate-pyproject/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-dev - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-dev@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Validate pyproject.toml run: | diff --git a/.github/actions/ci/version-check/action.yml b/.github/actions/ci/version-check/action.yml index fc7f170..16afb52 100644 --- a/.github/actions/ci/version-check/action.yml +++ b/.github/actions/ci/version-check/action.yml @@ -12,9 +12,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/install-python-dev - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/install-python-dev@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Check version consistency run: | diff --git a/.github/actions/setup/install-python-core/action.yml b/.github/actions/setup/install-python-core/action.yml index 5bf9797..7380966 100644 --- a/.github/actions/setup/install-python-core/action.yml +++ b/.github/actions/setup/install-python-core/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/setup-uv-python - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/setup-uv-python@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Install dependencies run: | diff --git a/.github/actions/setup/install-python-dev/action.yml b/.github/actions/setup/install-python-dev/action.yml index be96318..f2d8917 100644 --- a/.github/actions/setup/install-python-dev/action.yml +++ b/.github/actions/setup/install-python-dev/action.yml @@ -6,9 +6,9 @@ runs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup/setup-uv-python - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/setup/setup-uv-python@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' - name: Install dependencies run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5fb4e9..536d9de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,9 @@ jobs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/build/build-wheel - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/build/build-wheel@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' verify-structure: runs-on: ubuntu-latest @@ -24,6 +24,6 @@ jobs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/build/verify-structure - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/build/verify-structure@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f368253..c61f9e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,60 +14,60 @@ jobs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ci/validate-pyproject - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/ci/validate-pyproject@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' ruff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ci/ruff - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/ci/ruff@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' mypy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ci/mypy - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/ci/mypy@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' pytest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ci/pytest - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/ci/pytest@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' bandit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ci/bandit - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/ci/bandit@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' pip-audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ci/pip-audit - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/ci/pip-audit@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python' version-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ci/version-check - if: ${{ github.event.repository.name == 'template-python' }} + if: github.event.repository.name == 'template-python' - uses: javidahmed64592/template-python/.github/actions/ci/version-check@main - if: ${{ github.event.repository.name != 'template-python' }} + if: github.event.repository.name != 'template-python'