Skip to content

Commit 5fc9b01

Browse files
committed
try another thing
1 parent 7af2c26 commit 5fc9b01

File tree

2 files changed

+44
-64
lines changed

2 files changed

+44
-64
lines changed

dispatch/dist/action.js

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ var zlib = require('zlib');
1616

1717
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1818

19+
function getDefaultExportFromCjs (x) {
20+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
21+
}
22+
1923
function getAugmentedNamespace(n) {
2024
if (n.__esModule) return n;
2125
var a = Object.defineProperty({}, '__esModule', {value: true});
@@ -416,6 +420,8 @@ exports.getState = getState;
416420
//# sourceMappingURL=core.js.map
417421
});
418422

423+
var core$1 = /*@__PURE__*/getDefaultExportFromCjs(core);
424+
419425
var context = createCommonjsModule(function (module, exports) {
420426
Object.defineProperty(exports, "__esModule", { value: true });
421427
exports.Context = void 0;
@@ -6005,47 +6011,35 @@ exports.getOctokit = getOctokit;
60056011
//# sourceMappingURL=github.js.map
60066012
});
60076013

6014+
var github$1 = /*@__PURE__*/getDefaultExportFromCjs(github);
6015+
60086016
async function run() {
60096017
try {
6010-
const token = core.getInput("token");
6011-
const repo = core.getInput("repo");
6012-
const branch = core.getInput("branch");
6013-
const docs_path = core.getInput("docs_path");
6014-
const pkg_path = core.getInput("pkg_path");
6018+
const token = core$1.getInput("token");
6019+
const repo = core$1.getInput("repo");
6020+
const branch = core$1.getInput("branch");
6021+
const docs_path = core$1.getInput("docs_path");
6022+
const pkg_path = core$1.getInput("pkg_path");
60156023

60166024
console.log(token.length);
60176025

6018-
const octokit = github.getOctokit(token);
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-
// });
6046-
core.info(`API response status: ${dispatchResp.status} 🚀`);
6026+
const octokit = github$1.getOctokit(token);
6027+
6028+
const dispatchResp = await octokit.rest.actions.createWorkflowDispatch({
6029+
owner: "sveltejs",
6030+
repo: "sites",
6031+
workflow_id: "docs-deploy-trigger.yml",
6032+
ref: "master",
6033+
inputs: {
6034+
repo,
6035+
branch,
6036+
docs_path,
6037+
pkg_path,
6038+
},
6039+
});
6040+
core$1.info(`API response status: ${dispatchResp.status} 🚀`);
60476041
} catch (error) {
6048-
core.setFailed(error.message);
6042+
core$1.setFailed(error.message);
60496043
}
60506044
}
60516045

dispatch/main.ts

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as core from "@actions/core";
2-
import * as github from "@actions/github";
1+
import core from "@actions/core";
2+
import github from "@actions/github";
33

44
async function run(): Promise<void> {
55
try {
@@ -12,33 +12,19 @@ async function run(): Promise<void> {
1212
console.log(token.length);
1313

1414
const octokit = github.getOctokit(token);
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-
// });
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+
});
4228
core.info(`API response status: ${dispatchResp.status} 🚀`);
4329
} catch (error) {
4430
core.setFailed(error.message);

0 commit comments

Comments
 (0)