feat: allow glob on releaseFiles input

This commit is contained in:
DiogoAbu
2021-03-11 19:43:14 -03:00
parent ace656b089
commit 26a9aa82ba
3 changed files with 99 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
import * as core from '@actions/core';
import * as fs from "fs";
import fg from "fast-glob";
import { uploadToPlayStore } from "./edits";
const {google} = require('googleapis');
@@ -84,14 +85,13 @@ async function run() {
validatedReleaseFiles = [releaseFile];
}
} else if (releaseFiles.length > 0) {
for (const file of releaseFiles) {
core.debug(`Validating ${file} exists`)
if (!fs.existsSync(file)) {
core.setFailed(`Unable to find release file @ ${file}`);
return;
}
core.debug(`Finding files using glob ${releaseFiles}`)
const files = await fg(releaseFiles);
if (!files.length) {
core.setFailed(`Unable to find any release file @ ${releaseFiles}`);
return;
}
validatedReleaseFiles = releaseFiles;
validatedReleaseFiles = files;
}
if (whatsNewDir != undefined && whatsNewDir.length > 0 && !fs.existsSync(whatsNewDir)) {