From 500d1b854b3c1b9c64a9ed60e6c3d651abaafd54 Mon Sep 17 00:00:00 2001 From: Zanie Date: Fri, 15 Sep 2023 14:54:24 -0500 Subject: [PATCH] Demo full changes --- .github/workflows/ci.yaml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c71a48382b..a6646e32ef 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -370,16 +370,27 @@ jobs: tmp: runs-on: ubuntu-latest steps: - - name: "Checkout Branch" - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: - ref: main + ref: main # We checkout the main branch to check for the commit - name: Check main branch run: | # Fetch the main branch since a shallow checkout is used by default git fetch origin main --unshallow - git branch --contains f936d319ccf50b8af873e2dbe0cea7232d34efac - if ! git branch --contains f936d319ccf50b8af873e2dbe0cea7232d34efac | grep -E '(^|\s)main$'; then + if ! git branch --contains 0c030b5bf31e425cb6070db7386243eca6dbd8f1 | grep -E '(^|\s)main$'; then echo "The specified sha is not on the main branch" >&2 exit 1 fi + - name: Check tag consistency + run: | + # Switch to the commit we want to release + git checkout 0c030b5bf31e425cb6070db7386243eca6dbd8f1 + version=$(grep "version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g') + if [ "${{ inputs.tag }}" != "${version}" ]; then + echo "The input tag does not match the version from pyproject.toml:" >&2 + echo "${{ inputs.tag }}" >&2 + echo "${version}" >&2 + exit 1 + else + echo "Releasing ${version}" + fi