Slide 41
Slide 41 text
TypeScriptファイル
index.ts
import * as core from "@actions/core";
import * as soracom from "./soracom";
async function main() {
const soraletApi = new soracom.API.SoraletApi();
const authRequest = new soracom.Model.AuthRequest();
authRequest.authKey = core.getInput("soracom_auth_key",
{ required: true });
……
try {
const uploadResult = await soraletApi.uploadSoraletCode(
soraletId,
requestFile,
"application/octet-stream");
core.setOutput("result", uploadResult.body);
} catch (error) {
core.setFailed(errorMessage);
}
}
今回はTypeScriptで記述し、
トランスパイルして
dist/index.jsを作ります。
Copyright © Alterbooth Inc. All Rights Reserved. 41