Sync TailwindCSS Release Tag #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync TailwindCSS Release Tag | |
| on: | |
| # schedule: | |
| # - cron: '0 6 * * *' # Runs every day at 06:00 UTC | |
| # Run manually for now (need to update the version in the binary also) | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| sync-tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout current repo | |
| uses: actions/checkout@v4 | |
| - name: Fetch latest tag from tailwindcss | |
| id: get_latest_tailwind_tag | |
| run: | | |
| LATEST_TAG=$(curl -s https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest | jq -r .tag_name) | |
| echo "Latest TailwindCSS tag is $LATEST_TAG" | |
| echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT | |
| - name: Fetch tags from this repo | |
| id: get_existing_tags | |
| run: | | |
| git fetch --tags | |
| EXISTING_TAG=$(git tag -l "${{ steps.get_latest_tailwind_tag.outputs.tag }}") | |
| echo "existing=$EXISTING_TAG" >> $GITHUB_OUTPUT | |
| - name: Create new tag if missing | |
| if: steps.get_existing_tags.outputs.existing == '' | |
| run: | | |
| NEW_TAG=${{ steps.get_latest_tailwind_tag.outputs.tag }} | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag "$NEW_TAG" | |
| git push origin "$NEW_TAG" |