Skip to content

Commit 91b1db6

Browse files
authored
Merge pull request #1592 from microsoftgraph/feat/api-surface-validation
Add API surface validation workflow
2 parents da09326 + c2b2070 commit 91b1db6

File tree

1 file changed

+49
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)