Skip to content

Commit d4393ab

Browse files
Still output success result when skip the breaking change check (#3201)
* Still output success result when skip the check --------- Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>
1 parent 9163b79 commit d4393ab

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/breaking-change-check.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,56 +38,66 @@ jobs:
3838
check_breaking_changes:
3939
needs: get_matrix
4040
name: Check Breaking Changes
41-
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
4241
runs-on: ubuntu-latest
4342
strategy:
4443
matrix: ${{ fromJSON(needs.get_matrix.outputs.matrix) }}
4544
steps:
4645
# Checks-out your repository under $GITHUB_WORKSPACE so job can access it
4746
- uses: actions/checkout@v3
47+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
4848
with:
4949
fetch-depth: 0
5050
# Ensure node version is great enough
5151
- name: Use Node.js v14.x
52+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
5253
uses: actions/setup-node@v3
5354
with:
5455
node-version: '14.x'
5556
# Try get node_modules from cache
5657
- name: Restore node_modules from cache
58+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
5759
uses: actions/cache@v3
5860
with:
5961
path: common/temp/pnpm-store
6062
key: ${{ runner.os }}-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
6163
# Install dependencies
6264
- name: Install rush
65+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
6366
run: npm install -g @microsoft/rush@5.47.0
6467
- name: Install dependencies
68+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
6569
run: rush install --max-install-attempts 3
6670
# Switch flavor if necessary
6771
- name: Switch flavor for stable build
6872
id: switch-flavor
69-
if: ${{ matrix.flavor == 'stable' }}
73+
if: ${{ matrix.flavor == 'stable' && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
7074
run: |
7175
rush switch-flavor:stable
7276
- name: Check result of flavor switch
7377
if: ${{ always() && steps.switch-flavor.outcome == 'failure' }}
7478
run: echo "Failed to switch to stable flavor, please make sure you run 'rush update:stable' if dependencies were updated." && exit 1
7579
# Checkout the branch to be merged into in PR
7680
- name: Checkout base branch
81+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
7782
run: git checkout ${{ github.event.pull_request.base.ref }}
7883
- name: Build base api file
84+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
7985
run: rush build -t @azure/communication-react
8086
- name: Copy api file
87+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
8188
working-directory: packages/communication-react/
8289
run: |
8390
mkdir -p breaking-change-check/snapshots/
8491
cp dist/communication-react.d.ts breaking-change-check/snapshots/
8592
- name: Checkout current branch
93+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
8694
run: git checkout ${{ github.event.pull_request.head.ref }}
8795
# Builds
8896
- name: Build current api file
97+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
8998
run: rush build -t @azure/communication-react
9099
- name: Check breaking changes
100+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change') }}
91101
working-directory: packages/communication-react/
92102
id: breaking-changes
93103
run: rushx check-breaking-change
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Still output success result when skip the check",
4+
"packageName": "@azure/communication-react",
5+
"email": "jiangnanhello@live.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Still output success result when skip the check",
4+
"packageName": "@azure/communication-react",
5+
"email": "jiangnanhello@live.com",
6+
"dependentChangeType": "none"
7+
}

0 commit comments

Comments
 (0)