Skip to content

Add Venus Protocol info #130

Add Venus Protocol info

Add Venus Protocol info #130

name: Validate configuration files
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- 'main'
jobs:
validate_json_files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Or your preferred version
- name: Validate JSON files
run: |
export BASE_SHA=${{ github.event.pull_request.base.sha }}
export HEAD_SHA=$(git rev-parse HEAD)
git diff --quiet $BASE_SHA $HEAD_SHA -- config.json || (echo "file config.json must not change" && exit 1)
CHANGED_PROTOCOLS=$(git diff --name-only $BASE_SHA $HEAD_SHA -- 'protocols/*' | grep '^protocols/' | xargs -L1 dirname | sed 's|protocols/||' | sort -u)
CHANGED_PROTOCOLS=$CHANGED_PROTOCOLS node validate-config.js