Skip to content

Commit b131c1f

Browse files
committed
HYPERFLEET-930 - ci: skip version bump check for non-contract PRs
1 parent 5c39355 commit b131c1f

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff 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
@@ -39,7 +41,24 @@ jobs:
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: |

0 commit comments

Comments
 (0)