From 897aee4a42bb2e6a1e734f21f23905541d7b6b65 Mon Sep 17 00:00:00 2001 From: Jesse Talavera Date: Fri, 31 May 2024 13:49:21 -0400 Subject: [PATCH] Only publish a release when `main` is updated --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 275aeb7..935f5c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,10 +63,10 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 - if: "${{ steps.changelog.outputs.version != steps.newest-tag.outputs.version }}" + if: "${{ steps.changelog.outputs.version != steps.newest-tag.outputs.version && github.event_name == 'push' && github.ref == 'refs/heads/main' }}" - name: Create Release - if: "${{ steps.changelog.outputs.version != steps.newest-tag.outputs.version }}" + if: "${{ steps.changelog.outputs.version != steps.newest-tag.outputs.version && github.event_name == 'push' && github.ref == 'refs/heads/main'}}" uses: softprops/action-gh-release@v2.0.4 with: token: ${{ secrets.RELEASE_TOKEN }}