run-workflow.js 408 B

12345678910
  1. // Trigger a specific workflow on a specific branch.
  2. module.exports = async ({github, context, branchTargeted, workflowToTrigger}) => {
  3. console.log(`Run the workflow #${workflowToTrigger} on the branch '${branchTargeted}'`);
  4. await github.rest.actions.createWorkflowDispatch({
  5. owner: context.repo.owner,
  6. repo: context.repo.repo,
  7. workflow_id: workflowToTrigger,
  8. ref: branchTargeted,
  9. })
  10. }