Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Commit 74819a9

Browse files
committed
configure の実行を追加
1 parent 521299d commit 74819a9

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ inputs:
66
required: false
77
description: 'The version of Qiita CLI to install.'
88
default: 'latest'
9+
access-token:
10+
required: true
11+
description: 'Your Qiita access token.'
12+
format:
13+
required: false
14+
description: 'Default output format.'
15+
default: table
916
github-token:
1017
required: false
1118
description: 'Used to pull Qiita CLI from Github'

src/main.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const core = require("@actions/core");
2+
const exec = require("@actions/exec");
23
const github = require("@actions/github");
34
const tc = require("@actions/tool-cache");
45

@@ -108,10 +109,25 @@ const _download = async (version) => {
108109
return cliPath;
109110
};
110111

112+
/**
113+
* @param {String} accessToken
114+
* @param {String} format
115+
*/
116+
const configure = async (accessToken, format) => {
117+
await exec.exec("qiita", [
118+
"configure",
119+
"--access-token",
120+
accessToken,
121+
"--format",
122+
format,
123+
]);
124+
};
125+
111126
(async () => {
112127
const version = await _getVersion(core.getInput("version"));
113128
const cliPath = await _download(version);
114129
await _install(version, cliPath);
130+
await configure(core.getInput("access-token"), core.getInput("format"));
115131
})().catch((err) => {
116132
core.setFailed(err.message);
117133
});

0 commit comments

Comments
 (0)