From dc64be80d3d238b7999f3996d3bb6257c0754c5a 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:53 +0000 Subject: [PATCH 1/2] ci: only publish from tags that are on main --- .fernignore | 1 + .github/workflows/ci.yml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.fernignore b/.fernignore index e0b523b..a53bd4d 100644 --- a/.fernignore +++ b/.fernignore @@ -2,6 +2,7 @@ # Custom CI/CD .github/workflows/auto-close-empty-prs.yml +.github/workflows/ci.yml .github/workflows/draft-release.yml # Our own license diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f32646..43fee78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,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 Java id: setup-jre From e83d40dc0c39ff8594c2307dbefce3acb2526673 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:49 +0000 Subject: [PATCH 2/2] ci: skip publish steps instead of failing when tag is not on main --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43fee78..e82ba51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,10 +50,18 @@ 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 Java + if: steps.tag-on-main.outputs.on-main == 'true' id: setup-jre uses: actions/setup-java@v1 with: @@ -61,6 +69,7 @@ jobs: architecture: x64 - name: Publish to maven + if: steps.tag-on-main.outputs.on-main == 'true' run: | ./gradlew sonatypeCentralUpload env: