Skip to main content
Every pull request to the Color Palettes repository is automatically validated by Continuous Integration (CI) checks. These automated tests ensure that all contributions meet the project’s quality standards before merging.

Overview of CI Validation

The validation workflow runs automatically when:

Pull Requests

Any PR targeting the main branch that modifies JSON files

Direct Pushes

Any push to the main branch that modifies JSON files
File Triggers:
  • *.json (root level JSON files)
  • palettes/**/*.json (JSON files in palettes directory)

CI Workflow Structure

The complete workflow is defined in .github/workflows/validate-schema.yml:

Validation Checks Explained

Check 1: JSON Schema Validation

Validates that color-palettes.json conforms to the defined schema in schema.json.Validation Rules:
Pattern: ^[A-Za-z0-9\\s\\-_().₮]+$Valid Examples:
  • ✅ "Ethereum"
  • ✅ "Polygon zkEVM"
  • ✅ "1inch"
  • ✅ "USD₮"
Invalid Examples:
  • ❌ "Protocol/Name" (contains /)
  • ❌ "Protocol@Chain" (contains @)
  • ❌ "Protocol#1" (contains #)
Pattern: ^#[0-9A-Fa-f]{6}$Valid Examples:
  • ✅ "#627EEA"
  • ✅ "#FF007A"
  • ✅ "#000000"
Invalid Examples:
  • ❌ "627EEA" (missing # prefix)
  • ❌ "#627" (too short)
  • ❌ "#627EEAFF" (too long - no alpha)
  • ❌ "#GG0000" (invalid hex characters)
Requirements:
  • Must be an array
  • Minimum 1 item
  • All items must be unique
  • Each item matches: ^[a-zA-Z0-9_\\s.₮-]+$
Valid Examples:
  • ✅ ["ethereum", "eth", "weth"]
  • ✅ ["polygon"]
  • ✅ ["usd-tether-0"]
Invalid Examples:
  • ❌ [] (empty array)
  • ❌ ["eth", "eth"] (duplicates)
  • ❌ ["eth/weth"] (invalid character /)
Every protocol entry must include:
  • "hex" (string)
  • "aliases" (array)
Valid Example:
Invalid Examples:

Check 2: Duplicate Alias Detection

Ensures no alias is used by multiple protocols, using case-insensitive comparison.Detection Logic:
  1. Extracts all aliases from all protocols
  2. Converts each alias to lowercase
  3. Tracks which protocol “owns” each lowercase alias
  4. Fails if any alias appears in multiple protocols
Example Conflict:
CI Output:

Interpreting CI Results

Successful Validation

When all checks pass, you’ll see:
Your pull request is ready for maintainer review!

Failed Validation

When checks fail, you’ll see specific error messages:
What to do:
  1. Read the error message carefully
  2. Identify the problematic path (e.g., /Ethereum/hex)
  3. Check the value against the schema requirements
  4. Fix the issue in your color-palettes.json
  5. Commit and push the fix

Troubleshooting CI Failures

Symptoms: No CI checks appear on your PRPossible Causes:
  1. You didn’t modify any JSON files
  2. Changes are in a different directory
  3. Branch protection not configured
Solutions:
  • Ensure you modified color-palettes.json or files in palettes/**/*.json
  • Check the “Files changed” tab in your PR
  • Verify the workflow file exists in .github/workflows/
Symptoms: CI checks show “Expected — Waiting for status to be reported”Possible Causes:
  1. GitHub Actions queue delay
  2. Workflow requires approval (first-time contributors)
  3. Repository Actions disabled
Solutions:
  • Wait a few minutes for the queue
  • Ask a maintainer to approve workflow run
  • Check if Actions are enabled in repository settings
Symptoms: CI fails but error message is unclearSolutions:
  1. Click “Details” next to the failed check
  2. Expand the failed step to see full logs
  3. Copy the exact error message
  4. Search documentation or existing issues
  5. Comment on your PR asking for clarification
Maintainers are happy to help interpret CI errors. Include the full error message in your comment.
Symptoms: Made changes but CI shows same errorPossible Causes:
  1. Changes not committed
  2. Changes not pushed
  3. CI running on old commit
Solutions:
Check the commit SHA in the PR to ensure CI is running on your latest commit.
Symptoms: Local validation passes but CI failsPossible Causes:
  1. Different versions of tools (jq, etc.)
  2. Line ending differences (Windows vs. Unix)
  3. Testing different file
Solutions:
  • Ensure you’re testing the exact same file
  • Check for whitespace or encoding issues
  • Trust CI results over local tests
  • Review the CI logs for specific differences

Running Validation Locally

You can run the same checks locally before submitting:
1

Install Required Tools

2

Validate JSON Schema

3

Check for Duplicate Aliases

Best Practices for Passing CI

Validate Before Committing

Run local validation before every commit to catch issues early

Follow the Schema Exactly

Don’t add extra fields or use different formats than specified

Check for Existing Aliases

Search the JSON file before adding new aliases to avoid conflicts

Use Automated Formatting

Format your JSON with jq or your editor’s formatter

Getting Help

If you’re stuck with CI failures:
  1. Read the error message carefully - it usually tells you exactly what’s wrong
  2. Check this documentation for explanations and solutions
  3. Review Contribution Guidelines for best practices
  4. Search existing issues and PRs for similar problems
  5. Comment on your PR asking for help (include the full error message)
CI checks are designed to help you, not block you. When they fail, they’re providing valuable feedback to improve your contribution.