From 14c8419ded53ff4809db0dcf6619a8e246d681c5 Mon Sep 17 00:00:00 2001 From: Eli Hooten Date: Wed, 12 Jan 2022 20:08:42 -0600 Subject: [PATCH] Add Regex Checking on Tags This change adds a method of checking tags on a regex to ensure that arbitrary tags do not kick off a release to PYPI --- .github/workflows/run.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 243b3db..b0ea5ff 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -31,17 +31,27 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Check For Version Tag + id: check-tag + run: | + if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo ::set-output name=match::true + fi - name: Set up Python + if: steps.check-tag.outputs.match == 'true' uses: actions/setup-python@v2 with: python-version: 3.8 - name: Install Packaging Tools + if: steps.check-tag.outputs.match == 'true' run: | make package.install - name: Build Package + if: steps.check-tag.outputs.match == 'true' run: | make package.build - - name: Publish package to TestPyPi + - name: Publish package to PyPi + if: steps.check-tag.outputs.match == 'true' uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__