From 5be23c3e5a9ea820b5c8c57b0919bd4aada01c3c Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Tue, 5 Nov 2024 14:03:55 +0300 Subject: [PATCH] Add kiota dom to validate public api surface changes --- .../workflows/validate-public-api-surface.yml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/validate-public-api-surface.yml diff --git a/.github/workflows/validate-public-api-surface.yml b/.github/workflows/validate-public-api-surface.yml new file mode 100644 index 00000000000..2250d1e0ab1 --- /dev/null +++ b/.github/workflows/validate-public-api-surface.yml @@ -0,0 +1,47 @@ +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.hasExplanations != '' && github.event_name == 'pull_request' }} + continue-on-error: true + with: + comment: ${{ steps.diff.outputs.explanationsFilePath }} + 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' + - name: Upload explanations file as artifact + if: always() + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: explanations + path: 'explanations.txt' \ No newline at end of file