File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ name: Run tests
22on :
33 push :
44 branches : ["**"]
5+ pull_request :
6+ branches : ["**"]
57
68permissions :
79 contents : write
6466 docs/assets/coverage.svg
6567 if-no-files-found : ignore
6668 - name : Parse coverage percent
67- if : always()
69+ if : ${{ always() && github.event_name == 'pull_request' }}
6870 id : parsecov
6971 run : |
7072 python - << 'PY'
8385 PY
8486
8587 - name : Determine badge color
86- if : always()
88+ if : ${{ always() && github.event_name == 'pull_request' }}
8789 id : color
8890 run : |
8991 PCT=$(cat coverage_percent.txt || echo 0)
@@ -96,11 +98,11 @@ jobs:
9698 echo "pct=$PCT" >> $GITHUB_OUTPUT
9799
98100 - name : Ensure docs/assets directory
99- if : always()
101+ if : ${{ always() && github.event_name == 'pull_request' }}
100102 run : mkdir -p docs/assets
101103
102104 - name : Generate coverage badge
103- if : always()
105+ if : ${{ always() && github.event_name == 'pull_request' }}
104106 uses : emibcn/badge-action@v2.0.2
105107 with :
106108 label : coverage
@@ -115,8 +117,8 @@ jobs:
115117 name : coverage-badge
116118 path : docs/assets/coverage.svg
117119
118- - name : Commit coverage badge (push builds)
119- if : ${{ always() && github.event_name == 'push' }}
120+ - name : Commit coverage badge (push builds on non-main branches )
121+ if : ${{ always() && github.event_name == 'push' && github.ref != 'refs/heads/main' }}
120122 uses : EndBug/add-and-commit@v9
121123 with :
122124 add : " docs/assets/coverage.svg"
You can’t perform that action at this time.
0 commit comments