]> Nishi Git Mirror - gwion.git/commitdiff
:wrench: Fix branchname resolution during report generation
authorChase <44284917+TotallyNotChase@users.noreply.github.com>
Sun, 4 Oct 2020 16:37:39 +0000 (00:37 +0800)
committerChase <44284917+TotallyNotChase@users.noreply.github.com>
Sun, 4 Oct 2020 16:37:39 +0000 (00:37 +0800)
.github/workflows/coverage.yml

index 0ae18b50c3a8c5427335cacb9b179af1036841ed..8cfa34f789ca59989bfdfc0e5e9e0d5979badb95 100644 (file)
@@ -53,7 +53,13 @@ jobs:
         COV_NUM=${COV_TXT: : -1}
         echo $COV_NUM > gwion-coverage-report/coverage_num.txt
         sed -i 's/<html>/<script type="text\/javascript" src="..\/focus.js"><\/script><html>/' index.src_*.html
-        branch=$(basename ${{ github.event.ref }})
+        if [ "${{ github.event_name }}" == "push" ]
+        then
+          ref="${{ github.ref }}"
+        else
+          ref="${{ github.event.head.ref }}"
+        fi
+        branch=$(basename ref)
         cd gwion-coverage-report/
         bash old.sh $branch
         bash summary.sh