Skip to content

Commit 12ba3a3

Browse files
TEST 2/3: OCLIF manifest breaking change detection (removed command + flag)
1 parent 2f9bc85 commit 12ba3a3

4 files changed

Lines changed: 771 additions & 714 deletions

File tree

.github/workflows/tests-pr.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,53 @@ jobs:
287287
header: Type-diff
288288
message: ${{ steps.type-diff.outputs.report }}
289289
recreate: true
290+
291+
major-change-check:
292+
if: github.event.pull_request.head.repo.full_name == github.repository
293+
name: 'Breaking change detection'
294+
runs-on: ubuntu-latest
295+
timeout-minutes: 30
296+
outputs:
297+
has_breaking_changes: ${{ steps.check.outputs.has_breaking_changes }}
298+
steps:
299+
- uses: actions/checkout@v3
300+
with:
301+
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
302+
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
303+
fetch-depth: 1
304+
- name: Setup deps
305+
uses: ./.github/actions/setup-cli-deps
306+
with:
307+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
308+
- name: Build
309+
run: pnpm nx run-many --all --skip-nx-cache --target=build --output-style=stream
310+
- name: Check for breaking changes
311+
id: check
312+
run: node workspace/src/major-change-check.js
313+
- uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # v2.3.1
314+
if: steps.check.outputs.has_breaking_changes == 'true'
315+
with:
316+
header: Breaking-change-detection
317+
message: ${{ steps.check.outputs.report }}
318+
recreate: true
319+
- uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # v2.3.1
320+
if: steps.check.outputs.has_breaking_changes != 'true'
321+
with:
322+
header: Breaking-change-detection
323+
delete: true
324+
- name: Fail if breaking changes detected
325+
if: steps.check.outputs.has_breaking_changes == 'true'
326+
run: |
327+
echo '::error::Breaking changes detected. A member of @shopify/dev_experience must approve the breaking-change-approval environment.'
328+
exit 1
329+
330+
major-change-approval:
331+
name: 'Breaking change approval'
332+
needs: major-change-check
333+
if: always() && needs.major-change-check.outputs.has_breaking_changes == 'true'
334+
runs-on: ubuntu-latest
335+
timeout-minutes: 5
336+
environment: breaking-change-approval
337+
steps:
338+
- name: Approved
339+
run: echo '✅ Breaking changes approved by dev_experience team member'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,4 @@ packages/cli-kit/src/cli/api/graphql/*/*_schema.graphql
206206

207207
# Local dev alias scripts
208208
bin/p
209+

0 commit comments

Comments
 (0)