Skip to content

Commit a6f3dea

Browse files
feat(ci): add breaking change detection workflow
1 parent f8828b7 commit a6f3dea

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/detect-breaking-changes.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,34 @@ on:
66
- next
77

88
jobs:
9+
detect_breaking_changes:
10+
runs-on: 'ubuntu-latest'
11+
name: detect-breaking-changes
12+
if: github.repository == 'openai/openai-node'
13+
steps:
14+
- name: Calculate fetch-depth
15+
run: |
16+
echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV
17+
18+
- uses: actions/checkout@v4
19+
with:
20+
# Ensure we can check out the pull request base in the script below.
21+
fetch-depth: ${{ env.FETCH_DEPTH }}
22+
23+
- name: Set up Node
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: '20'
27+
- name: Install dependencies
28+
run: |
29+
yarn install
30+
31+
- name: Detect breaking changes
32+
run: |
33+
# Try to check out previous versions of the breaking change detection script. This ensures that
34+
# we still detect breaking changes when entire files and their tests are removed.
35+
git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true
36+
./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}
937
agents_sdk:
1038
runs-on: 'ubuntu-latest'
1139
name: Detect Agents SDK regressions

0 commit comments

Comments
 (0)