Skip to content

Commit

Permalink
use gh
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderDevisscher committed Aug 23, 2024
1 parent 79812c9 commit 48989fc
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/trigger_build_pkgdown_site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ jobs:
trigger-build:
runs-on: ubuntu-latest
steps:
- name: Install gh
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
- name: Configure gh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh auth login --with-token <<< "$GITHUB_TOKEN"
- name: Trigger Build pkgdown site
uses: actions/github-script@v6
with:
script: |
const workflow_id = "Build pkgdown site"; // The name of the workflow to trigger
const response = await github.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id,
ref: context.ref, // The branch or tag to run the workflow on
});
console.log(`Triggered workflow: ${response.data.message}`);
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run "Build pkgdown site"

0 comments on commit 48989fc

Please sign in to comment.