Skip to content

Update -google.com.css Fix #1550 #1155

Update -google.com.css Fix #1550

Update -google.com.css Fix #1550 #1155

name: Format and Update styles.json
on:
push:
paths:
- "websites/**/*.css"
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
format-and-update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install dependencies (initial)
run: npm install
- name: Run Prettier
uses: creyD/[email protected]
with:
prettier_options: '--write .'
commit_message: "gh-actions: format code"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Reinstall dependencies after Prettier
run: npm install
- name: Run script to update styles.json
run: node update-styles-json.mjs
- name: Validate styles.json
run: jq empty styles.json
- name: Commit and push styles.json if changed
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add styles.json
if git diff --cached --quiet; then
echo "No changes to styles.json."
exit 0
fi
git commit -m 'Update styles.json'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}