Skip to content

Commit

Permalink
try gh api command
Browse files Browse the repository at this point in the history
  • Loading branch information
zerbitx committed Aug 8, 2024
1 parent 78b7ce8 commit 5919afa
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/cli-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,14 @@ jobs:
name: Trigger CLI Docs Update
runs-on: ubuntu-latest
steps:
- name: Trigger cli-docs workflow
uses: actions/github-script@v7
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const title = 'from pr ${{ github.event.pull_request.number }}'
const version = 'some-version';
const ref = '${{ github.event.pull_request.head.sha }}';
const response = await github.rest.actions.createWorkflowDispatch({
owner: 'loft-sh',
repo: 'vcluster-docs',
workflow_id: 'cli-docs.yaml',
ref: 'main',
inputs: {
version: version,
ref: ref,
title: title,
}
});
console.log(response)
- name: Trigger CLI Docs Update workflow in vcluster-docs
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/loft-sh/vcluster-docs/dispatches \
-f "event_type=update-cli-docs" \
-F "client_payload[ref]={{ github.event.pull_request.head.ref }}" \
-F "client_payload[title]={{ github.event.pull_request.title }}"
-F "client_payload[version]=some-version"

0 comments on commit 5919afa

Please sign in to comment.