octoflare
Advanced tools
Comparing version 0.6.1 to 0.7.0
import { Octokit } from 'octokit'; | ||
export type DispatchWorkflow = (dispatch_params: NonNullable<Parameters<Octokit['rest']['actions']['createWorkflowDispatch']>[0]>) => Promise<unknown>; | ||
type createWorkflowDispatch = Octokit['rest']['actions']['createWorkflowDispatch']; | ||
export type DispatchWorkflow = (dispatch_params: NonNullable<Parameters<createWorkflowDispatch>[0]>) => ReturnType<createWorkflowDispatch>; | ||
export {}; |
import { Octokit } from 'octokit'; | ||
import { CompleteCheckRun } from './CompleteCheckRun.js'; | ||
import { DispatchWorkflow } from './DispatchWorkflow.js'; | ||
@@ -7,3 +8,6 @@ export type OctoflareInstallation = { | ||
token: string; | ||
createCheckRun: (params: NonNullable<Parameters<Octokit['rest']['checks']['create']>[0]>) => Promise<DispatchWorkflow>; | ||
createCheckRun: (params: NonNullable<Parameters<Octokit['rest']['checks']['create']>[0]>) => Promise<{ | ||
completeCheckRun: CompleteCheckRun; | ||
dispatchWorkflow: DispatchWorkflow; | ||
}>; | ||
}; |
@@ -32,6 +32,13 @@ import memoize from 'lodash/memoize.js'; | ||
onCreateCheck(check_run_id); | ||
return async (dispatch_params) => { | ||
const octokit = await getRepoInstallation(dispatch_params); | ||
const completeCheckRun = ((params) => kit.rest.checks.update({ | ||
check_run_id, | ||
owner: params.owner, | ||
repo: params.repo, | ||
status: 'completed', | ||
...params | ||
})); | ||
const dispatchWorkflow = (async (params) => { | ||
const octokit = await getRepoInstallation(params); | ||
return octokit.rest.actions.createWorkflowDispatch({ | ||
...dispatch_params, | ||
...params, | ||
inputs: { | ||
@@ -42,5 +49,9 @@ token, | ||
check_run_id, | ||
...dispatch_params.inputs | ||
...params.inputs | ||
} | ||
}); | ||
}); | ||
return { | ||
completeCheckRun, | ||
dispatchWorkflow | ||
}; | ||
@@ -47,0 +58,0 @@ } |
{ | ||
"name": "octoflare", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"description": "A framework for building GitHub Apps with Cloudflare Worker", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15199
41
301