From 23fa274e6b8609db587623d6f1f05346b023bd11 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 12 Mar 2024 15:56:05 -0400 Subject: [PATCH] Add a comment on coverage to PRs. (#196) Signed-off-by: dblock --- .github/workflows/coverage.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 922176c9e..532e5120f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,6 +1,6 @@ name: API Coverage -on: [push, pull_request] +on: [push, pull_request_target] env: JAVA_VERSION: 11 @@ -8,12 +8,14 @@ env: jobs: coverage: - runs-on: ubuntu-latest permissions: pull-requests: write + runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Build and Run Docker Container run: | docker build coverage --tag opensearch-with-api-plugin @@ -40,3 +42,14 @@ jobs: total=`jq -r '.paths | keys | length' OpenSearch.auto.openapi.json` percent=$((current * 100 / total)) echo "API specs implemented for $current/$total ($percent%) APIs." + cat >>"$GITHUB_OUTPUT" <