Attempt to delete the archive after extraction (#209)

This reduces storage space used once the Action has finished executing.
This commit is contained in:
Henry Mercer 2020-03-18 13:43:56 +00:00 committed by GitHub
parent af8651e0c5
commit cae64ca3cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 18 deletions

View file

@ -3,6 +3,7 @@ import * as io from "@actions/io";
import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import * as util from "util";
import * as uuidV4 from "uuid/v4";
import { Events, Outputs, State } from "../constants";
@ -105,3 +106,7 @@ export function isValidEvent(): boolean {
const githubEvent = process.env[Events.Key] || "";
return getSupportedEvents().includes(githubEvent);
}
export function unlinkFile(path: fs.PathLike): Promise<void> {
return util.promisify(fs.unlink)(path);
}