mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-08-30 07:38:29 +00:00
refactor: use built-in getExecOutput (#292)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
+12
-7
@@ -1,12 +1,17 @@
|
||||
import * as exec from './exec';
|
||||
import * as exec from '@actions/exec';
|
||||
|
||||
const git = async (args: string[] = []): Promise<string> => {
|
||||
return await exec.exec(`git`, args, true).then(res => {
|
||||
if (res.stderr != '' && !res.success) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
return res.stdout.trim();
|
||||
});
|
||||
return await exec
|
||||
.getExecOutput(`git`, args, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
})
|
||||
.then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
return res.stdout.trim();
|
||||
});
|
||||
};
|
||||
|
||||
export async function getTag(): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user