Skip to content

Commit

Permalink
try branch
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanrajh committed Oct 26, 2023
1 parent e533bbb commit 1140250
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/scripts/trigger-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ const octokit = new Octokit({

async function triggerWorkflow() {
try {
const response = await octokit.repos.createDispatchEvent({
const response = await octokit.rest.actions.createWorkflowDispatch({
owner: 'shopware',
repo: 'developer-portal',
//event_type: 'trigger-workflow',
ref: `refs/heads/DX-healthcheck`,
workflow_id: 'external-healthcheck.yml',
client_payload: {
branch: process.env.DEV_HUB_BRANCH,
repo: process.env.DEV_HUB_REPO,
sha: process.env.DEV_HUB_SHA,
},
});
/*const response = await octokit.repos.createDispatchEvent({
owner: 'shopware',
repo: 'developer-portal',
event_type: 'trigger-workflow',
Expand All @@ -18,7 +30,7 @@ async function triggerWorkflow() {
repo: process.env.DEV_HUB_REPO,
sha: process.env.DEV_HUB_SHA,*/
},
});
});*/

console.log("Workflow triggered successfully:", response.data);
} catch (error) {
Expand Down

0 comments on commit 1140250

Please sign in to comment.