We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5ad0ab3 + 0fa1d14 commit 2f17d28Copy full SHA for 2f17d28
.github/workflows/trigger_build_pkgdown_site.yaml
@@ -24,8 +24,16 @@ jobs:
24
25
- name: Trigger Build pkgdown site
26
run: |
27
- # Extract the branch name from the full reference
28
- BRANCH_NAME=${GITHUB_REF##*/}
+ # Determine the branch name based on the event type
+ if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
29
+ # If triggered by a workflow_run, use the head_ref from the triggering workflow
30
+ BRANCH_NAME=${{ github.event.workflow_run.head_branch }}
31
+ else
32
+ # For other events, use the ref
33
+ BRANCH_NAME=${GITHUB_REF##*/}
34
+ fi
35
+
36
+ echo "Triggering Build pkgdown site on branch: $BRANCH_NAME"
37
gh workflow run "Build pkgdown site" --ref "$BRANCH_NAME"
38
env:
39
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
0 commit comments