diff --git a/.github/workflows/validatePublicAPISurface.yml b/.github/workflows/validatePublicAPISurface.yml new file mode 100644 index 00000000000..15f28c45764 --- /dev/null +++ b/.github/workflows/validatePublicAPISurface.yml @@ -0,0 +1,40 @@ +name: Validate Public API surface changes + +on: + workflow_dispatch: + push: + pull_request: + branches: [ 'main' ] + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: microsoftgraph/kiota-dom-export-diff-tool/export@main + id: generatePatch + - uses: microsoftgraph/kiota-dom-export-diff-tool/tool@main + if: ${{ steps.generatePatch.outputs.patchFilePath != '' }} + with: + path: ${{ steps.generatePatch.outputs.patchFilePath }} + fail-on-removal: true + id: diff + - uses: microsoftgraph/kiota-dom-export-diff-tool/comment@main + if: ${{ always() && steps.generatePatch.outputs.patchFilePath != '' && steps.diff.outputs.explanations != '' && github.event_name == 'pull_request' }} + continue-on-error: true + with: + comment: ${{ steps.diff.outputs.explanations }} + prNumber: ${{ github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload patch file as artifact + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: patch + path: '*.patch' \ No newline at end of file