Edits history of script submission #312 for ' Dispatch Workflow Run (github)'

  • deno
    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 399 days ago

  • deno
    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 959 days ago

  • deno
    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 1031 days ago

  • deno
    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 1034 days ago

  • deno
    import { Resource } from "https://deno.land/x/[email protected]/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 1160 days ago