Skip to content

Commit

Permalink
Update examples.yml (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
howard-e authored Feb 21, 2024
1 parent 16dbe83 commit 51bd34b
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,22 @@ jobs:
- name: Generate coverage files
run: npm run coverage-report

- name: Ensure no git changes
run: git diff --exit-code
- name: Check for git changes
id: check_changes_coverage_report
run: |
(git diff --exit-code) && true
echo "exit-code=$(echo $?)" >> $GITHUB_OUTPUT
- name: Update default branch with updated coverage report if changed
if: github.ref == 'refs/heads/main' && steps.check_changes_coverage_report.outputs.exit-code != 0
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "chore: update coverage report page's last updated date
Generated by ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
"
git push origin main
- name: Return exit code if not default branch
if: github.ref != 'refs/heads/main'
run: exit ${{ steps.check_changes_coverage_report.outputs.exit-code }}

0 comments on commit 51bd34b

Please sign in to comment.