Skip to content

Commit

Permalink
Add a comment on coverage to PRs.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Mar 7, 2024
1 parent 21b3e2b commit b4ca367
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ env:

jobs:
coverage:
runs-on: ubuntu-latest
# if: github.repository == 'opensearch-project/opensearch-api-specification'
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
Expand All @@ -40,3 +43,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" <<EOL
current=$current
total=$total
percent=$percent
EOL
- uses: peter-evans/create-or-update-comment@v4
if: github.event_name == 'pull_request_target'
with:
issue-number: ${{ github.event.number }}
body: |
API specs implemented for ${{ steps.coverage.outputs.current }}/${{ steps.coverage.outputs.total }} (${{ steps.coverage.outputs.percent }}%) APIs.

0 comments on commit b4ca367

Please sign in to comment.