mirror of
https://github.com/actions/github-script.git
synced 2026-04-08 07:00:05 +00:00
Replace @action/github dependency with latest Octokit
This commit is contained in:
parent
5ee2b97722
commit
f734337387
18 changed files with 32329 additions and 5341 deletions
9
types/async-function.d.ts
vendored
9
types/async-function.d.ts
vendored
|
|
@ -1,15 +1,14 @@
|
|||
/// <reference types="node" />
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import { Context } from '@actions/github/lib/context';
|
||||
import { GitHub } from '@actions/github/lib/utils';
|
||||
import * as glob from '@actions/glob';
|
||||
import * as io from '@actions/io';
|
||||
import { Octokit } from '@octokit/action';
|
||||
import { Context } from './context.js';
|
||||
export declare type AsyncFunctionArguments = {
|
||||
context: Context;
|
||||
core: typeof core;
|
||||
github: InstanceType<typeof GitHub>;
|
||||
octokit: InstanceType<typeof GitHub>;
|
||||
github: InstanceType<typeof Octokit>;
|
||||
octokit: InstanceType<typeof Octokit>;
|
||||
exec: typeof exec;
|
||||
glob: typeof glob;
|
||||
io: typeof io;
|
||||
|
|
|
|||
72
types/context.d.ts
vendored
Normal file
72
types/context.d.ts
vendored
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
export interface PayloadRepository {
|
||||
[key: string]: any;
|
||||
full_name?: string;
|
||||
name: string;
|
||||
owner: {
|
||||
[key: string]: any;
|
||||
login: string;
|
||||
name?: string;
|
||||
};
|
||||
html_url?: string;
|
||||
}
|
||||
export interface WebhookPayload {
|
||||
[key: string]: any;
|
||||
repository?: PayloadRepository;
|
||||
issue?: {
|
||||
[key: string]: any;
|
||||
number: number;
|
||||
html_url?: string;
|
||||
body?: string;
|
||||
};
|
||||
pull_request?: {
|
||||
[key: string]: any;
|
||||
number: number;
|
||||
html_url?: string;
|
||||
body?: string;
|
||||
};
|
||||
sender?: {
|
||||
[key: string]: any;
|
||||
type: string;
|
||||
};
|
||||
action?: string;
|
||||
installation?: {
|
||||
id: number;
|
||||
[key: string]: any;
|
||||
};
|
||||
comment?: {
|
||||
id: number;
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
export declare class Context {
|
||||
/**
|
||||
* Webhook payload object that triggered the workflow
|
||||
*/
|
||||
payload: WebhookPayload;
|
||||
eventName: string;
|
||||
sha: string;
|
||||
ref: string;
|
||||
workflow: string;
|
||||
action: string;
|
||||
actor: string;
|
||||
job: string;
|
||||
runAttempt: number;
|
||||
runNumber: number;
|
||||
runId: number;
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
graphqlUrl: string;
|
||||
/**
|
||||
* Hydrate the context from the environment
|
||||
*/
|
||||
constructor();
|
||||
get issue(): {
|
||||
owner: string;
|
||||
repo: string;
|
||||
number: number;
|
||||
};
|
||||
get repo(): {
|
||||
owner: string;
|
||||
repo: string;
|
||||
};
|
||||
}
|
||||
18
types/src/async-function.d.ts
vendored
Normal file
18
types/src/async-function.d.ts
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as glob from '@actions/glob';
|
||||
import * as io from '@actions/io';
|
||||
import { Octokit } from '@octokit/action';
|
||||
import { Context } from './context.js';
|
||||
export declare type AsyncFunctionArguments = {
|
||||
context: Context;
|
||||
core: typeof core;
|
||||
github: InstanceType<typeof Octokit>;
|
||||
octokit: InstanceType<typeof Octokit>;
|
||||
exec: typeof exec;
|
||||
glob: typeof glob;
|
||||
io: typeof io;
|
||||
require: NodeRequire;
|
||||
__original_require__: NodeRequire;
|
||||
};
|
||||
export declare function callAsyncFunction<T>(args: AsyncFunctionArguments, source: string): Promise<T>;
|
||||
72
types/src/context.d.ts
vendored
Normal file
72
types/src/context.d.ts
vendored
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
export interface PayloadRepository {
|
||||
[key: string]: any;
|
||||
full_name?: string;
|
||||
name: string;
|
||||
owner: {
|
||||
[key: string]: any;
|
||||
login: string;
|
||||
name?: string;
|
||||
};
|
||||
html_url?: string;
|
||||
}
|
||||
export interface WebhookPayload {
|
||||
[key: string]: any;
|
||||
repository?: PayloadRepository;
|
||||
issue?: {
|
||||
[key: string]: any;
|
||||
number: number;
|
||||
html_url?: string;
|
||||
body?: string;
|
||||
};
|
||||
pull_request?: {
|
||||
[key: string]: any;
|
||||
number: number;
|
||||
html_url?: string;
|
||||
body?: string;
|
||||
};
|
||||
sender?: {
|
||||
[key: string]: any;
|
||||
type: string;
|
||||
};
|
||||
action?: string;
|
||||
installation?: {
|
||||
id: number;
|
||||
[key: string]: any;
|
||||
};
|
||||
comment?: {
|
||||
id: number;
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
export declare class Context {
|
||||
/**
|
||||
* Webhook payload object that triggered the workflow
|
||||
*/
|
||||
payload: WebhookPayload;
|
||||
eventName: string;
|
||||
sha: string;
|
||||
ref: string;
|
||||
workflow: string;
|
||||
action: string;
|
||||
actor: string;
|
||||
job: string;
|
||||
runAttempt: number;
|
||||
runNumber: number;
|
||||
runId: number;
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
graphqlUrl: string;
|
||||
/**
|
||||
* Hydrate the context from the environment
|
||||
*/
|
||||
constructor();
|
||||
get issue(): {
|
||||
owner: string;
|
||||
repo: string;
|
||||
number: number;
|
||||
};
|
||||
get repo(): {
|
||||
owner: string;
|
||||
repo: string;
|
||||
};
|
||||
}
|
||||
1
types/types/non-webpack-require.d.ts
vendored
Normal file
1
types/types/non-webpack-require.d.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
Loading…
Add table
Add a link
Reference in a new issue