File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ name: Documentation upload
44
55permissions :
66 contents : write
7+ actions : read
8+
79on :
810 workflow_run :
911 workflows : ["Documentation"]
@@ -15,15 +17,28 @@ jobs:
1517 runs-on : ubuntu-latest
1618 steps :
1719 - name : 🤍 Mirror workflow status 🤍
20+ id : status
1821 run : |
1922 if [[ "${{ github.event.workflow_run.conclusion }}" != "success" ]]; then
2023 echo "The main workflow failed or was cancelled."
2124 exit 1
2225 fi
2326
27+ ALL_SUCCESS=$(gh api "${{ github.event.workflow_run.jobs_url }}" \
28+ --jq 'all(.jobs[]; .conclusion == "success")')
29+
30+ if [[ "$ALL_SUCCESS" != true ]]; then
31+ echo "not updating badge because one or more build jobs were skipped"
32+ echo "skipped=true" >> "$GITHUB_OUTPUT"
33+ else
34+ echo "skipped=false" >> "$GITHUB_OUTPUT"
35+ fi
36+ env :
37+ GH_TOKEN : ${{ github.token }}
38+
2439 - name : 🤍 Publish workflow badge 🤍
2540 uses : rarestype/rarestbadge@v1
26- if : always()
41+ if : always() && steps.status.outputs.skipped != 'true'
2742 with :
2843 badge : Documentation/_all
2944 title : Documentation
You can’t perform that action at this time.
0 commit comments