File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 11name : Mirror latest release to GitHub Pages with LFS
22
33on :
4- release :
5- types : [published]
4+ workflow_run :
5+ workflows : ['Release']
6+ types : [completed]
7+ branches : [main]
68 workflow_dispatch :
79 inputs :
810 tag :
@@ -15,11 +17,18 @@ permissions:
1517jobs :
1618 mirror :
1719 runs-on : ubuntu-latest
20+ # Only run if the triggering workflow succeeded (when triggered by workflow_run)
21+ if : ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
1822 steps :
1923 - name : Get release info
2024 id : release
2125 run : |
22- TAG="${{ github.event.inputs.tag || github.event.release.tag_name }}"
26+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
27+ TAG="${{ github.event.inputs.tag }}"
28+ else
29+ # Get the latest release tag when triggered by workflow_run
30+ TAG=$(gh api "repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name')
31+ fi
2332 echo "tag=$TAG" >> "$GITHUB_OUTPUT"
2433
2534 # Get release metadata
You can’t perform that action at this time.
0 commit comments