Merge pull request #161 from azaurus1/dependabot/go_modules/integrati… #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update API Coverage Badge | |
on: | |
push: | |
branches: | |
- main # or your default branch | |
jobs: | |
update-badge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up environment | |
run: echo "COVERAGE_AUTH_KEY=${{ secrets.COVERAGE_AUTH_KEY }}" >> $GITHUB_ENV | |
- name: Calculate API Coverage | |
id: coverage | |
run: | | |
cd tools/coverage/ | |
go run coverage.go | |
# Assuming the tool outputs coverage in coverage.txt | |
COVERAGE=$(cat coverage.txt) | |
echo "COVERAGE=$COVERAGE" >> $GITHUB_ENV | |
- name: Update Badge | |
run: | | |
curl -X POST -d "coverage=${{ env.COVERAGE }}" -H "Authorization: ${{ env.COVERAGE_AUTH_KEY }}" https://api-coverage-server.azaurus.dev/badge |