Skip to content

Commit 7af2c26

Browse files
committed
try a thing
1 parent a6c636d commit 7af2c26

File tree

2 files changed

+55
-28
lines changed

2 files changed

+55
-28
lines changed

dispatch/dist/action.js

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6016,22 +6016,36 @@ async function run() {
60166016
console.log(token.length);
60176017

60186018
const octokit = github.getOctokit(token);
6019-
6020-
const dispatchResp = await octokit.rest.actions.createWorkflowDispatch({
6021-
owner: "sveltejs",
6022-
repo: "sites",
6023-
workflow_id: "docs-deploy-trigger.yml",
6024-
ref: "master",
6025-
inputs: {
6026-
repo,
6027-
branch,
6028-
docs_path,
6029-
pkg_path,
6030-
},
6031-
});
6019+
const dispatchResp = await octokit.request(
6020+
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
6021+
{
6022+
owner: "sveltejs",
6023+
repo: "sites",
6024+
workflow_id: "docs-deploy-trigger.yml",
6025+
ref: "master",
6026+
inputs: {
6027+
repo,
6028+
branch,
6029+
docs_path,
6030+
pkg_path,
6031+
},
6032+
}
6033+
);
6034+
// const dispatchResp = await octokit.rest.actions.createWorkflowDispatch({
6035+
// owner: "sveltejs",
6036+
// repo: "sites",
6037+
// workflow_id: "docs-deploy-trigger.yml",
6038+
// ref: "master",
6039+
// inputs: {
6040+
// repo,
6041+
// branch,
6042+
// docs_path,
6043+
// pkg_path,
6044+
// },
6045+
// });
60326046
core.info(`API response status: ${dispatchResp.status} 🚀`);
60336047
} catch (error) {
6034-
throw error;
6048+
core.setFailed(error.message);
60356049
}
60366050
}
60376051

dispatch/main.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,35 @@ async function run(): Promise<void> {
1212
console.log(token.length);
1313

1414
const octokit = github.getOctokit(token);
15-
16-
const dispatchResp = await octokit.rest.actions.createWorkflowDispatch({
17-
owner: "sveltejs",
18-
repo: "sites",
19-
workflow_id: "docs-deploy-trigger.yml",
20-
ref: "master",
21-
inputs: {
22-
repo,
23-
branch,
24-
docs_path,
25-
pkg_path,
26-
},
27-
});
15+
const dispatchResp = await octokit.request(
16+
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
17+
{
18+
owner: "sveltejs",
19+
repo: "sites",
20+
workflow_id: "docs-deploy-trigger.yml",
21+
ref: "master",
22+
inputs: {
23+
repo,
24+
branch,
25+
docs_path,
26+
pkg_path,
27+
},
28+
}
29+
);
30+
// const dispatchResp = await octokit.rest.actions.createWorkflowDispatch({
31+
// owner: "sveltejs",
32+
// repo: "sites",
33+
// workflow_id: "docs-deploy-trigger.yml",
34+
// ref: "master",
35+
// inputs: {
36+
// repo,
37+
// branch,
38+
// docs_path,
39+
// pkg_path,
40+
// },
41+
// });
2842
core.info(`API response status: ${dispatchResp.status} 🚀`);
2943
} catch (error) {
30-
throw error;
3144
core.setFailed(error.message);
3245
}
3346
}

0 commit comments

Comments
 (0)