Skip to content

Update UI Kits

Update UI Kits #32

name: "Update UI Kits"
on:
schedule:
- cron: "0 4 * * 6"
workflow_dispatch: null
jobs:
update-ui-kits:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Set up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
cache: "yarn"
cache-dependency-path: "yarn.lock"
node-version-file: ".nvmrc"
- name: Install
env:
HUSKY: 0
run: yarn install --immutable
- name: Run update task
run: yarn update-ui-kits
env:
CHECK_COUNT: 200
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Detect changes
id: changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Configure Git
if: steps.changes.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and push changes
if: steps.changes.outputs.changed == 'true'
run: |
BRANCH="update-ui-kits"
git checkout -B "$BRANCH"
git add -A
git commit -m "fix: update UI kits"
git push --force origin "$BRANCH"
- name: Create Pull Request with GitHub CLI
if: steps.changes.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh pr create \
--base "${{ github.event.repository.default_branch }}" \
--head "update-ui-kits" \
--title "fix: update UI kits ($(date +'%Y-%m-%d'))" \
--body "Automated weekly update triggered by the **Weekly UI Kits Update** workflow."