37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: CSS quality
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
css-quality:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
cache: npm
|
|
- run: npm ci
|
|
- name: Resolve the complete change range
|
|
env:
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
PR_BASE: ${{ github.event.pull_request.base.sha }}
|
|
PUSH_BEFORE: ${{ github.event.before }}
|
|
run: |
|
|
if [ "$EVENT_NAME" = pull_request ]; then
|
|
base=$(git merge-base "$PR_BASE" HEAD)
|
|
elif [ "$PUSH_BEFORE" = 0000000000000000000000000000000000000000 ]; then
|
|
base=$(git hash-object -t tree /dev/null)
|
|
else
|
|
git cat-file -e "$PUSH_BEFORE^{commit}"
|
|
base=$PUSH_BEFORE
|
|
fi
|
|
echo "QUALITY_BASE_REF=$base" >> "$GITHUB_ENV"
|
|
- name: Verify changed formatting and CSS ownership
|
|
run: npm run format:check && npm run style:check && npm run css:verify
|