Skip to content

Commit 74643d1

Browse files
authored
Merge pull request #2626 from microsoftgraph/feature/public-api-surface-validation
ci: adds a workflow to validate public API surface changes
2 parents d0ec0c0 + 8d0a065 commit 74643d1

File tree

1 file changed

+47
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)