Skip to content

feat(eds-tokens): use single css variables export #398

feat(eds-tokens): use single css variables export

feat(eds-tokens): use single css variables export #398

Workflow file for this run

name: PR Title Check
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: Check PR Title Format
shell: bash
run: |
title="${{ github.event.pull_request.title }}"
echo "πŸ” Checking PR title: '$title'"
# Fail fast for spacing mistakes
# Check for any space before ':' (covers both "type :" and "type(scope) :")
if [[ "$title" =~ " :" ]]; then
echo "❌ Invalid title: No space allowed before ':'"
echo " Use: 'type: description' not 'type : description'"
echo " Use: 'type(scope): description' not 'type(scope) : description'"
exit 1
fi
# Check for space before '(' (e.g. "feat (scope)")
if [[ "$title" =~ ^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)[[:space:]] ]] && [[ "$title" =~ \( ]]; then
echo "❌ Invalid title: No space allowed before '('"
echo " Use: 'type(scope): description' not 'type (scope): description'"
exit 1
fi
# Require either "type: desc" or "type(scope): desc"
re='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-zA-Z0-9][a-zA-Z0-9_-]*(,[a-zA-Z0-9][a-zA-Z0-9_-]*)*\))?(!)?: +[^ ].+$'
if [[ "$title" =~ $re ]]; then
echo "βœ… Title matches Conventional Commits"
else
echo "❌ Invalid title: Must follow conventional commit format"
echo " Valid formats:"
echo " β€’ type: description"
echo " β€’ type(scope): description"
echo " β€’ type(scope)!: breaking change description"
echo " Examples:"
echo " β€’ feat: add new component"
echo " β€’ fix(eds-tokens): resolve build issue"
echo " β€’ feat(core)!: remove deprecated API"
exit 1
fi
# Optional: validate scope(s) if present
if [[ "$title" =~ ^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)\(([^\)]+)\) ]]; then
scope_content="${BASH_REMATCH[2]}"
echo "πŸ“¦ Scope detected: '$scope_content'"
valid_scopes=("design-system-docs" "eds-color-palette-generator" "eds-core-react" "eds-data-grid-react" "eds-demo" "eds-icons" "eds-lab-react" "eds-tailwind" "eds-tokens" "eds-tokens-build" "eds-tokens-sync" "eds-utils" "figma-broker" "devcontainer" "github" "build" "deps" "config" "docs")
IFS=',' read -ra scopes <<< "$scope_content"
all_valid=true
for scope in "${scopes[@]}"; do
# no spaces are expected due to regex, but trim anyway
scope="$(echo "$scope" | sed -E 's/^[[:space:]]+|[[:space:]]+$//g')"
found=false
for vs in "${valid_scopes[@]}"; do [[ "$scope" == "$vs" ]] && found=true && break; done
if ! $found; then echo " ❌ Invalid scope: '$scope'"; all_valid=false; else echo " βœ… $scope"; fi
done
if ! $all_valid; then
echo ""
echo "❌ Invalid scope(s): One or more scopes are not recognized"
echo " Valid scopes:"
printf " β€’ %s\n" "${valid_scopes[@]}"
echo " Use: 'type(valid-scope): description'"
exit 1
fi
else
echo "πŸ“¦ No scope used (optional)"
fi
echo "βœ… PR title OK"