From 03ad294db0316b9c996501acc3b5923c429572e3 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Fri, 12 Jun 2026 14:27:59 +0200 Subject: [PATCH] fix(ci): add check to skip release if latest tag was created today (#4085) * fix(ci): add check to skip release if latest tag was created today * Apply dispatch gate to the ci workflow * Fix ci * Revert svg changes * Revert svg * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Format ci file --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e460ca55..0fe620531 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,37 @@ concurrency: group: continuous-integration jobs: + check-dispatch-gate: + if: github.repository == 'lucide-icons/lucide' && + startsWith(github.event.head_commit.message, 'feat(icons)') && + github.event_name != 'workflow_dispatch' + runs-on: ubuntu-latest + outputs: + RELEASE_ENVIRONMENT: ${{ steps.environment.outputs.RELEASE_ENVIRONMENT }} + steps: + - uses: actions/checkout@v6 + + - name: Fetch tags + run: git fetch --all --tags + + - name: Check if latest tag was created today + id: environment + run: | + LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1) + TAG_DATE=$(git log -1 --format=%cs "$LATEST_TAG") + TODAY=$(date +%Y-%m-%d) + + if [ "$TAG_DATE" == "$TODAY" ]; then + echo "::warning::A release tag already exists for today ($TODAY): $LATEST_TAG. Manual approval will be required to proceed." + echo "RELEASE_ENVIRONMENT=Icon Release Gated" >> $GITHUB_OUTPUT + else + echo "RELEASE_ENVIRONMENT=Icon Release" >> $GITHUB_OUTPUT + fi + create-release: - if: github.repository == 'lucide-icons/lucide' && startsWith(github.event.head_commit.message, 'feat(icons)') && github.event_name != 'workflow_dispatch' + if: github.repository == 'lucide-icons/lucide' + needs: check-dispatch-gate + environment: ${{ needs.check-dispatch-gate.outputs.RELEASE_ENVIRONMENT }} runs-on: ubuntu-latest outputs: VERSION: ${{ steps.new-version.outputs.NEW_VERSION }}