File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ jobs:
1515 steps :
1616 - name : Checkout code
1717 uses : actions/checkout@v6
18+ with :
19+ fetch-depth : 0
1820
1921 - name : Setup Node.js
2022 uses : actions/setup-node@v6
2123 with :
22- node-version : ' 20 '
24+ node-version : " 20 "
2325
2426 - name : Install dependencies
2527 run : npm ci
3941 run : |
4042 npx spectral lint schemas/core/openapi.yaml --format github-actions --fail-severity warn
4143
44+ - name : Check for contract changes
45+ id : contract
46+ run : |
47+ BASE_REF="${{ github.event.pull_request.base.sha || github.event.before }}"
48+ if [ -z "$BASE_REF" ] || ! git cat-file -e "$BASE_REF" 2>/dev/null; then
49+ echo "changed=true" >> "$GITHUB_OUTPUT"
50+ exit 0
51+ fi
52+ CHANGED=$(git diff --name-only "$BASE_REF" HEAD -- '*.tsp')
53+ if [ -n "$CHANGED" ]; then
54+ echo "changed=true" >> "$GITHUB_OUTPUT"
55+ else
56+ echo "changed=false" >> "$GITHUB_OUTPUT"
57+ echo "No contract files changed — skipping version bump check"
58+ fi
59+
4260 - name : Check version bump
61+ if : steps.contract.outputs.changed == 'true'
4362 env :
4463 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4564 run : |
You can’t perform that action at this time.
0 commit comments