From 4819aec3f73f61c94c194676cb770d4f0f67f0d3 Mon Sep 17 00:00:00 2001 From: micah johnson Date: Wed, 6 Sep 2023 07:38:33 -0600 Subject: [PATCH] Added svg saving to the test workflow for coverage badge --- .github/workflows/testing.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 34f4964..e612978 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -40,4 +40,25 @@ jobs: coverage report -m - name: Coverage Badge - uses: tj-actions/coverage-badge-py@v2 \ No newline at end of file + uses: tj-actions/coverage-badge-py@v2 + + - name: Verify Changed files + uses: tj-actions/verify-changed-files@v16 + id: verify-changed-files + with: + files: coverage.svg + + - name: Commit files + if: steps.verify-changed-files.outputs.files_changed == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add coverage.svg + git commit -m "Updated coverage.svg" + + - name: Push changes + if: steps.verify-changed-files.outputs.files_changed == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.github_token }} + branch: ${{ github.ref }} \ No newline at end of file