Skip to content

Commit

Permalink
Update trigger_build_pkgdown_site.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderDevisscher committed Aug 26, 2024
1 parent 5069720 commit 81f56f9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/trigger_build_pkgdown_site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ jobs:

- name: Trigger Build pkgdown site
run: |
# Extract the branch name from the full reference
BRANCH_NAME=${GITHUB_REF##*/}
# Determine the branch name based on the event type
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
# If triggered by a workflow_run, use the head_ref from the triggering workflow
BRANCH_NAME=${{ github.event.workflow_run.head_branch }}
else
# For other events, use the ref
BRANCH_NAME=${GITHUB_REF##*/}
fi
echo "Triggering Build pkgdown site on branch: $BRANCH_NAME"
gh workflow run "Build pkgdown site" --ref "$BRANCH_NAME"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 81f56f9

Please sign in to comment.