From cb84d6f005901bb1ecf78750399a6d0c787d9efc Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2026 21:52:46 +0000 Subject: [PATCH 1/2] ci: only publish from tags that are on main --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fd6ffd..1d82ca9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,10 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Ensure tag is on main + run: git merge-base --is-ancestor "$GITHUB_SHA" origin/main - name: Set up python uses: actions/setup-python@v4 with: From 2f9b863562b9964498dc29d4a08c87f029cec037 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2026 22:00:40 +0000 Subject: [PATCH 2/2] ci: skip publish steps instead of failing when tag is not on main --- .github/workflows/ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d82ca9..bf9c2ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,18 +57,30 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Ensure tag is on main - run: git merge-base --is-ancestor "$GITHUB_SHA" origin/main + - name: Check if tag is on main + id: tag-on-main + run: | + if git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then + echo "on-main=true" >> "$GITHUB_OUTPUT" + else + echo "on-main=false" >> "$GITHUB_OUTPUT" + echo "::notice::Skipping publish: tag $GITHUB_REF_NAME is not on main" + fi - name: Set up python + if: steps.tag-on-main.outputs.on-main == 'true' uses: actions/setup-python@v4 with: python-version: "3.10" - name: Bootstrap poetry + if: steps.tag-on-main.outputs.on-main == 'true' run: | curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - name: Install dependencies + if: steps.tag-on-main.outputs.on-main == 'true' run: poetry install - name: Build package + if: steps.tag-on-main.outputs.on-main == 'true' run: poetry --no-interaction -v build - name: Publish package + if: steps.tag-on-main.outputs.on-main == 'true' uses: pypa/gh-action-pypi-publish@release/v1