-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tao Liu <[email protected]>
- Loading branch information
1 parent
1ff4264
commit b346fd5
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Trigger OSD Build Image Workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
repository: | ||
description: Target repository | ||
required: true | ||
python_version: | ||
description: Python version | ||
type: string | ||
default: '3.9.17' | ||
required: true | ||
Node_version: | ||
description: Node version | ||
type: string | ||
default: '18.19.0' | ||
required: true | ||
OpenSearch-Dashboards_version: | ||
description: OpenSearch-Dashboards version | ||
type: string | ||
default: '3.0.0' | ||
required: true | ||
additional_args: | ||
description: JSON of additional options | ||
type: string | ||
default: '{}' | ||
required: true | ||
build_number: | ||
description: Build number | ||
type: string | ||
default: '' | ||
required: false | ||
|
||
jobs: | ||
trigger-osd-build-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger Build-OSD-Image Workflow | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.GH_ACCESS_TOKEN_RUNNER }} | ||
script: | | ||
const repositoryName = '${{ github.event.inputs.repository }}'; | ||
const pythonVersion = '${{ github.event.inputs.python_version }}'; | ||
const nodeVersion = '${{ github.event.inputs.Node_version }}'; | ||
const osdVersion = '${{ github.event.inputs.OpenSearch-Dashboards_version }}'; | ||
const additionalArgs = '${{ github.event.inputs.additional_args }}'; | ||
const buildNumber = '${{ github.event.inputs.build_number }}'; | ||
const response = await octokit.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { | ||
owner: 'Flyingliuhub', | ||
repo: repositoryName, | ||
workflow_id: 'Build-OSD-Image', // Replace with the actual workflow ID | ||
ref: 'main', // Replace with the branch you want to trigger | ||
inputs: { | ||
python_version: pythonVersion, | ||
Node_version: nodeVersion, | ||
OpenSearch-Dashboards_version: osdVersion, | ||
additional_args: additionalArgs, | ||
build_number: buildNumber, | ||
}, | ||
}); | ||
console.log(response.data); |