From 850606511a1ebefa6e5ac0aadfc720dcdcd65a34 Mon Sep 17 00:00:00 2001 From: ShawnDeng-code Date: Sun, 3 Aug 2025 14:05:41 +0800 Subject: [PATCH] fix: fix template github action --- .../.github/workflows/package-release.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/package-release.yaml b/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/package-release.yaml index 08aa0e7..1add0a0 100644 --- a/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/package-release.yaml +++ b/repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows/package-release.yaml @@ -31,6 +31,7 @@ jobs: publish-pypi: needs: test runs-on: ubuntu-latest + if: vars.PUBLISH_TO_PUBLIC_PYPI == 'true' permissions: contents: write id-token: write @@ -67,7 +68,12 @@ jobs: run: task deploy:pypi-server release: - needs: [test, publish-pypi, publish-private-pypi] + needs: [test, publish-private-pypi, publish-pypi] + {% raw %}if: | + ${{ always() && + needs.test.result == 'success' && + needs.publish-private-pypi.result == 'success' && + (needs.publish-pypi.result == 'success' || needs.publish-pypi.result == 'skipped') }}{% endraw %} runs-on: ubuntu-latest permissions: contents: write