cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
.github/workflows/detect-breaking-changes.yml
38lines · modecode
| 1 | name: CI |
| 2 | on: |
| 3 | pull_request: |
| 4 | branches: |
| 5 | - main |
| 6 | - next |
| 7 | |
| 8 | jobs: |
| 9 | detect_breaking_changes: |
| 10 | runs-on: 'ubuntu-latest' |
| 11 | name: detect-breaking-changes |
| 12 | # Temporarily disabled: major version bump in progress — breaking changes are expected. |
| 13 | # Re-enable once the v<next> release is cut. |
| 14 | if: false |
| 15 | steps: |
| 16 | - name: Calculate fetch-depth |
| 17 | run: | |
| 18 | echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV |
| 19 | |
| 20 | - uses: actions/checkout@v6 |
| 21 | with: |
| 22 | # Ensure we can check out the pull request base in the script below. |
| 23 | fetch-depth: ${{ env.FETCH_DEPTH }} |
| 24 | |
| 25 | - name: Set up Node |
| 26 | uses: actions/setup-node@v3 |
| 27 | with: |
| 28 | node-version: '20' |
| 29 | - name: Install dependencies |
| 30 | run: | |
| 31 | yarn install |
| 32 | |
| 33 | - name: Detect breaking changes |
| 34 | run: | |
| 35 | # Try to check out previous versions of the breaking change detection script. This ensures that |
| 36 | # we still detect breaking changes when entire files and their tests are removed. |
| 37 | git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true |
| 38 | ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }} |
| 39 | |