-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (32 loc) · 1.29 KB
/
sync-tailwind-tag.yml
File metadata and controls
37 lines (32 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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"