Skip to content

Added Theme builder workflow to detect change in variables #6

Added Theme builder workflow to detect change in variables

Added Theme builder workflow to detect change in variables #6

name: CSS Variables Sync Check
on:
pull_request:
paths:
- 'src/css-variables.ts'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Test repository access
run: |
echo "🔍 Testing repository access..."
echo "Repository: thoughtspot/Thoughtspot-theme-builder"
echo "Branch: release"
# Test repository access
RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.THEME_BUILDER_TOKEN }}" \
"https://api.github.com/repos/thoughtspot/Thoughtspot-theme-builder")
if echo "$RESPONSE" | grep -q "full_name"; then
echo "✅ Repository access confirmed"
# Test branch access
BRANCH_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.THEME_BUILDER_TOKEN }}" \
"https://api.github.com/repos/thoughtspot/Thoughtspot-theme-builder/branches/release")
if echo "$BRANCH_RESPONSE" | grep -q "name"; then
echo "✅ Release branch access confirmed"
else
echo "❌ Release branch not found or not accessible"
echo "Available branches:"
curl -s -H "Authorization: token ${{ secrets.THEME_BUILDER_TOKEN }}" \
"https://api.github.com/repos/thoughtspot/Thoughtspot-theme-builder/branches" | \
jq -r '.[].name' 2>/dev/null || echo "Could not fetch branches"
exit 1
fi
else
echo "❌ Cannot access repository. Response:"
echo "$RESPONSE"
echo ""
echo "Possible issues:"
echo "1. Token doesn't have access to this repository"
echo "2. Token is invalid or expired"
echo "3. Repository permissions issue"
exit 1
fi
- name: Checkout theme builder repo
uses: actions/checkout@v2
with:
repository: thoughtspot/Thoughtspot-theme-builder
path: theme-builder
ref: release
token: ${{ secrets.THEME_BUILDER_TOKEN }}
- name: Validate CSS variables
run: |
node scripts/validate-css-variables.js "$(cat theme-builder/src/data/sdkVariable.ts)"