mirror of https://github.com/mifi/lossless-cut
improve upload artifacts
parent
2601094200
commit
2601104eb5
@ -0,0 +1,24 @@
|
||||
import { DefaultArtifactClient } from '@actions/artifact';
|
||||
import assert from 'node:assert';
|
||||
import { basename } from 'node:path';
|
||||
import yargs from 'yargs';
|
||||
import { hideBin } from 'yargs/helpers';
|
||||
|
||||
|
||||
const args = yargs(hideBin(process.argv))
|
||||
.option('name', {
|
||||
type: 'string',
|
||||
})
|
||||
.parseSync();
|
||||
|
||||
assert(args._.length > 0, 'Please provide one or more files');
|
||||
|
||||
const client = new DefaultArtifactClient();
|
||||
|
||||
const name = args.name ?? basename(String(args._[0]));
|
||||
|
||||
await client.uploadArtifact(
|
||||
name,
|
||||
args._.map(String),
|
||||
process.cwd(), // root directory
|
||||
);
|
||||
Loading…
Reference in New Issue