diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 5d91738d..70328234 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -262,7 +262,9 @@ jobs: - run: pip install ansible-core - name: Publish the collection on Galaxy - if: github.ref_type == 'tag' || github.ref == 'refs/heads/main' + if: | + github.event_name == 'push' && + (github.ref_type == 'tag' || github.ref == 'refs/heads/main') run: > [[ "${{ secrets.ANSIBLE_GALAXY_API_KEY != '' }}" ]] || { echo "ANSIBLE_GALAXY_API_KEY is required to publish on galaxy" ; exit 1; }