From bcfc345d1360243eb8f38c39e75582712d6b05b8 Mon Sep 17 00:00:00 2001 From: Gonzalo Casas Date: Fri, 27 Sep 2024 16:06:33 +0200 Subject: [PATCH] another try at release from PR --- .github/workflows/release.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2119ca..5a69802 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,6 @@ name: Create Release jobs: build: - if: github.ref == 'refs/heads/main' runs-on: ${{ matrix.os }} strategy: matrix: @@ -15,6 +14,22 @@ jobs: python: ['3.9'] steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Fetch main branch + run: git fetch origin main + - name: Check if the tag is on the main branch + run: | + TAG_COMMIT=$(git rev-parse HEAD) + + # Check if the tag commit is in the main branch history + if git merge-base --is-ancestor $TAG_COMMIT origin/main; then + echo "Tag has landed on main. Releasing!" + else + echo "Tag is not on main yet. Exiting." + exit 1 + fi + - uses: compas-dev/compas-actions.build@v3 with: python: ${{ matrix.python }}