import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
/**
* @param owner The account owner of the repository. The name is not case sensitive.
*
* @param repo The name of the repository. The name is not case sensitive.
*
* @param workflow_id The ID of the workflow. You can also pass the workflow file
* name as a string.
*
* @param ref The git reference for the workflow. The reference can be a branch or
* tag name.
*
* @param inputs Input keys and values configured in the workflow file. The maximum
* number of properties is 10. Any default properties configured in the workflow
* file will be used when inputs are omitted.
*/
type Github = {
token: string;
};
export async function main(
gh_auth: Github,
owner: string,
repo: string,
workflow_id: string,
ref: string,
inputs?: Record<string | number, any>
) {
const octokit = new Octokit({ auth: gh_auth.token });
return await octokit.request(
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
{
owner,
repo,
workflow_id,
ref,
inputs: inputs || {},
headers: {
"X-GitHub-Api-Version": "2022-11-28",
Accept: "application/vnd.github+json",
},
}
);
}
Submitted by hugo697 407 days ago
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
/**
* @param owner The account owner of the repository. The name is not case sensitive.
*
* @param repo The name of the repository. The name is not case sensitive.
*
* @param workflow_id The ID of the workflow. You can also pass the workflow file
* name as a string.
*
* @param ref The git reference for the workflow. The reference can be a branch or
* tag name.
*
* @param inputs Input keys and values configured in the workflow file. The maximum
* number of properties is 10. Any default properties configured in the workflow
* file will be used when inputs are omitted.
*/
type Github = {
token: string;
};
export async function main(
gh_auth: Github,
owner: string,
repo: string,
workflow_id: string,
ref: string,
inputs?: Record<string | number, any>,
) {
const octokit = new Octokit({ auth: gh_auth.token });
return await octokit.request(
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
{
owner,
repo,
workflow_id,
ref,
inputs: inputs || {},
headers: {
"X-GitHub-Api-Version": "2022-11-28",
Accept: "application/vnd.github+json",
},
},
);
}
Submitted by admin 479 days ago
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
/**
* @param owner The account owner of the repository. The name is not case sensitive.
*
* @param repo The name of the repository. The name is not case sensitive.
*
* @param workflow_id The ID of the workflow. You can also pass the workflow file
* name as a string.
*
* @param ref The git reference for the workflow. The reference can be a branch or
* tag name.
*
* @param inputs Input keys and values configured in the workflow file. The maximum
* number of properties is 10. Any default properties configured in the workflow
* file will be used when inputs are omitted.
*/
type Github = {
token: string;
};
export async function main(
gh_auth: Github,
owner: string,
repo: string,
workflow_id: string,
ref: string,
inputs?: Record<string | number, any>,
) {
const octokit = new Octokit({ auth: gh_auth.token });
return await octokit.request(
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
{
owner,
repo,
workflow_id,
ref,
inputs: inputs || {},
headers: {
"X-GitHub-Api-Version": "2022-11-28",
Accept: "application/vnd.github+json",
},
},
);
}
Submitted by admin 483 days ago
import { Resource } from "https://deno.land/x/windmill@v1.85.0/mod.ts";
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
/**
* @param owner The account owner of the repository. The name is not case sensitive.
*
* @param repo The name of the repository. The name is not case sensitive.
*
* @param workflow_id The ID of the workflow. You can also pass the workflow file
* name as a string.
*
* @param ref The git reference for the workflow. The reference can be a branch or
* tag name.
*
* @param inputs Input keys and values configured in the workflow file. The maximum
* number of properties is 10. Any default properties configured in the workflow
* file will be used when inputs are omitted.
*/
export async function main(
gh_auth: Resource<"github">,
owner: string,
repo: string,
workflow_id: string,
ref: string,
inputs?: Record<string | number, any>,
) {
const octokit = new Octokit({ auth: gh_auth.token });
return await octokit.request(
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
{
owner,
repo,
workflow_id,
ref,
inputs: inputs || {},
headers: {
"X-GitHub-Api-Version": "2022-11-28",
Accept: "application/vnd.github+json",
},
},
);
}
Submitted by adam186 609 days ago