Skip to content

Commit

Permalink
chore: Fixed the new exlude_type usage (wasn't released yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrenskers committed Feb 22, 2021
1 parent 31ffa74 commit ea55b94
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7058,13 +7058,19 @@ function getConfig(path) {
return DEFAULT_CONFIG;
}

const TAG_REGEX = /^v?(\d+).(\d+).(\d+)$/i;

function validateTag(tag) {
return TAG_REGEX.test(tag);
}

async function run() {
const token = getInput("token", { required: true });
const octokit = getOctokit(token);

const configFile = getInput("config_file", { required: false });
const config = getConfig(configFile);
const excludeTypesString = getInput("exclude", { required: false }) || "";
const excludeTypesString = getInput("exclude_types", { required: false }) || "";

if (excludeTypesString) {
config.excludeTypes = excludeTypesString.split(",");
Expand All @@ -7078,7 +7084,7 @@ async function run() {
});

const validSortedTags = tags
.filter((t) => compareVersions.validate(t.name))
.filter((t) => validateTag(t.name))
.sort((a, b) => {
return compareVersions(a.name, b.name);
})
Expand Down
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ function getConfig(path) {
return DEFAULT_CONFIG;
}

const TAG_REGEX = /^v?(\d+).(\d+).(\d+)$/i;

function validateTag(tag) {
return TAG_REGEX.test(tag);
}

async function run() {
const token = getInput("token", { required: true });
const octokit = getOctokit(token);

const configFile = getInput("config_file", { required: false });
const config = getConfig(configFile);
const excludeTypesString = getInput("exclude", { required: false }) || "";
const excludeTypesString = getInput("exclude_types", { required: false }) || "";

if (excludeTypesString) {
config.excludeTypes = excludeTypesString.split(",");
Expand All @@ -47,7 +53,7 @@ async function run() {
});

const validSortedTags = tags
.filter((t) => compareVersions.validate(t.name))
.filter((t) => validateTag(t.name))
.sort((a, b) => {
return compareVersions(a.name, b.name);
})
Expand Down

0 comments on commit ea55b94

Please sign in to comment.