From cdd064b29712ece7bd5e00aee68fd0636553f605 Mon Sep 17 00:00:00 2001 From: Lucas Cimon <925560+Lucas-C@users.noreply.github.com> Date: Mon, 20 Jan 2025 14:21:26 +0100 Subject: [PATCH] MAINT: Avoiding useless execution of create-github-release & publish-to-pypi.yaml workflows for every commit on the main branch --- .github/workflows/create-github-release.yaml | 3 +++ .github/workflows/publish-to-pypi.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/create-github-release.yaml b/.github/workflows/create-github-release.yaml index ccd2958..49da5cc 100644 --- a/.github/workflows/create-github-release.yaml +++ b/.github/workflows/create-github-release.yaml @@ -15,11 +15,13 @@ permissions: jobs: build_and_publish: + if: ${{ github.event.workflow_run.conclusion == 'success' }} name: Create a GitHub release page runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 + - name: Prepare variables id: prepare_variables run: | @@ -31,6 +33,7 @@ jobs: echo "tag_body<<$EOF" >> "$GITHUB_ENV" git --no-pager tag -l "${latest_tag}" --format='%(contents:body)' >> "$GITHUB_ENV" echo "$EOF" >> "$GITHUB_ENV" + - name: Create GitHub Release 🚀 uses: softprops/action-gh-release@v2 with: diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml index aa0a396..7f9bf84 100644 --- a/.github/workflows/publish-to-pypi.yaml +++ b/.github/workflows/publish-to-pypi.yaml @@ -15,6 +15,7 @@ permissions: jobs: build_and_publish: + if: ${{ github.event.workflow_run.conclusion == 'success' }} name: Publish a new version runs-on: ubuntu-latest steps: