-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
41 lines (40 loc) · 1.24 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const core = require('@actions/core');
const { spawn } = require('child_process');
const path = require('path');
try {
const installprocess = spawn(path.resolve(__dirname, 'install'), [], {
stdio: ['inherit', 'inherit', 'inherit'],
env: {
PATH: process.env.PATH,
HOME: process.env.HOME,
GITHUB_ENV: process.env.GITHUB_ENV,
PATTERNS: core.getInput('patterns'),
CI_GPG_PRIVATE_KEY: core.getInput('ci-gpg-private-key'),
GITHUB_GOPASS_CI_TOKEN: core.getInput('github-gopass-ci-token'),
GOPASS_VERSION: core.getInput('gopass_version').replace(/^v/, ''),
SUMMON_VERSION: core.getInput('summon_version').replace(/^v/, ''),
GPG_FINGERPRINT: core.getInput('gpg-fingerprint'),
GITHUB_REPOSITORY: core.getInput('github-repository'),
},
});
installprocess.on('error', (error) => {
console.log('error');
console.log(error);
core.setFailed();
});
installprocess.on('exit', (code) => {
if (code != 0) {
console.log(`exit: ${code}`);
core.setFailed();
}
});
installprocess.on('close', (code) => {
if (code != 0) {
console.log(`close: ${code}`);
core.setFailed();
}
});
} catch (error) {
console.log('catch');
core.setFailed(error.message);
}