Skip to content

Commit e35ba77

Browse files
authored
Merge pull request #947 from microsoftgraph/shem/add_api_surface_validation
add workflow to validate api surface changes
2 parents f0dd6de + 450a869 commit e35ba77

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Validate Public API surface changes
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
branches: [ 'main' ]
8+
paths: ['msgraph/generated/**']
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
issues: write
14+
15+
jobs:
16+
validate-public-api-surface:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: microsoftgraph/kiota-dom-export-diff-tool/export@main
21+
id: generatePatch
22+
- uses: microsoftgraph/kiota-dom-export-diff-tool/tool@main
23+
if: ${{ steps.generatePatch.outputs.patchFilePath != '' }}
24+
with:
25+
path: ${{ steps.generatePatch.outputs.patchFilePath }}
26+
fail-on-removal: true
27+
id: diff
28+
- uses: microsoftgraph/kiota-dom-export-diff-tool/comment@main
29+
if: ${{ always() && steps.generatePatch.outputs.patchFilePath != '' && steps.diff.outputs.hasExplanations != '' && github.event_name == 'pull_request' }}
30+
continue-on-error: true
31+
with:
32+
comment: ${{ steps.diff.outputs.explanationsFilePath }}
33+
prNumber: ${{ github.event.pull_request.number }}
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
- name: Upload patch file as artifact
36+
if: always()
37+
uses: actions/upload-artifact@v4
38+
continue-on-error: true
39+
with:
40+
name: patch
41+
path: '*.patch'
42+
- name: Upload explanations file as artifact
43+
if: always()
44+
uses: actions/upload-artifact@v4
45+
continue-on-error: true
46+
with:
47+
name: explanations
48+
path: 'explanations.txt'

0 commit comments

Comments
 (0)