This repository was archived by the owner on Jul 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 6
6
required : false
7
7
description : ' The version of Qiita CLI to install.'
8
8
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
9
16
github-token :
10
17
required : false
11
18
description : ' Used to pull Qiita CLI from Github'
Original file line number Diff line number Diff line change 1
1
const core = require ( "@actions/core" ) ;
2
+ const exec = require ( "@actions/exec" ) ;
2
3
const github = require ( "@actions/github" ) ;
3
4
const tc = require ( "@actions/tool-cache" ) ;
4
5
@@ -108,10 +109,25 @@ const _download = async (version) => {
108
109
return cliPath ;
109
110
} ;
110
111
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
+
111
126
( async ( ) => {
112
127
const version = await _getVersion ( core . getInput ( "version" ) ) ;
113
128
const cliPath = await _download ( version ) ;
114
129
await _install ( version , cliPath ) ;
130
+ await configure ( core . getInput ( "access-token" ) , core . getInput ( "format" ) ) ;
115
131
} ) ( ) . catch ( ( err ) => {
116
132
core . setFailed ( err . message ) ;
117
133
} ) ;
You can’t perform that action at this time.
0 commit comments