diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b6f665954..fc534611c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,6 +10,8 @@ env: jobs: coverage: runs-on: ubuntu-latest + permissions: + pull-requests: write steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -38,4 +40,17 @@ jobs: cat diff.json | jq '.newEndpoints | group_by(.pathUrl)[] | .[0].pathUrl + ": " + (map(.method) | tostring)' --raw-output echo "-------- Legacy APIs" cat diff.json | jq '.missingEndpoints | group_by(.pathUrl)[] | .[0].pathUrl + ": " + (map(.method) | tostring)' --raw-output - + - name: Gather Coverage + id: coverage + shell: bash + run: | + echo "current=`cat OpenSearch.openapi.json | jq '.paths | keys[]' | wc -l`" >> $GITHUB_OUTPUT + echo "total=`cat OpenSearch.auto.openapi.json | jq '.paths | keys[]' | wc -l`" >> $GITHUB_OUTPUT + - name: Report Coverage + shell: bash + run: | + echo API specs implemented for ${{ steps.coverage.outputs.current }}/${{ steps.coverage.outputs.total }} APIs. + - uses: mshick/add-pr-comment@v2 + with: + message: | + API specs implemented for ${{ steps.coverage.outputs.current }}/${{ steps.coverage.outputs.total }} APIs.