Skip to content

Commit 383f95f

Browse files
committed
[autosync]
1 parent d5082b6 commit 383f95f

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/DocumentationUpload.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ name: Documentation upload
44

55
permissions:
66
contents: write
7+
actions: read
8+
79
on:
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

0 commit comments

Comments
 (0)