From c542163e69598b567161e4a1cd5688bab6cbcdc6 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Mon, 11 Sep 2023 23:45:49 -0500 Subject: [PATCH] CI: Fix tag serach value for TestPyPI publishing * As the tag events that trigger workflows are not prefixed by 'v' but instead just use SemVer numbers the GitHub Actions `startsWith` function can only check if a tag has been pushed, as `startsWith` does not support regex. - c.f. https://docs.github.com/en/actions/learn-github-actions/expressions#startswith --- .github/workflows/publish-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 903ccae9..ac7aa8e5 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -91,7 +91,7 @@ jobs: # Publish to TestPyPI on tag events of if manually triggered # Compare to 'true' string as booleans get turned into strings in the console if: >- - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') uses: pypa/gh-action-pypi-publish@v1.8.10 with: