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
4345 run : |
4446 npx spectral lint schemas/core/openapi.yaml schemas/gcp/openapi.yaml --format github-actions --fail-severity warn
4547
48+ - name : Check for contract changes
49+ id : contract
50+ run : |
51+ BASE_REF="${{ github.event.pull_request.base.sha || github.event.before }}"
52+ if [ -z "$BASE_REF" ] || ! git cat-file -e "$BASE_REF" 2>/dev/null; then
53+ echo "changed=true" >> "$GITHUB_OUTPUT"
54+ exit 0
55+ fi
56+ CHANGED=$(git diff --name-only "$BASE_REF" HEAD -- '*.tsp')
57+ if [ -n "$CHANGED" ]; then
58+ echo "changed=true" >> "$GITHUB_OUTPUT"
59+ else
60+ echo "changed=false" >> "$GITHUB_OUTPUT"
61+ echo "No contract files changed — skipping version bump check"
62+ fi
63+
4664 - name : Check version bump
65+ if : steps.contract.outputs.changed == 'true'
4766 env :
4867 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4968 run : |
You can’t perform that action at this time.
0 commit comments