Skip to content

Commit

Permalink
Fix match destructure
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangoree committed Dec 20, 2023
1 parent 5841a89 commit 0466824
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/actions/parse-ref-semver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ try {
core.info(`"${ref}" is not a valid semver reference.`);
} else {
const [
// path (e.g. "refs/tags/")
// Full match
_,
// Full prefix minus the optional "v" (e.g. refs/tags/@scope/name@)
// path (e.g. "refs/tags/")
__,
// Scope with the "@" (e.g. "@scope")
// Full prefix minus the optional "v" (e.g. refs/tags/@scope/name@)
___,
// Scope with the "@" (e.g. "@scope")
____,
scope,
name,
major,
Expand All @@ -40,7 +42,14 @@ try {
build,
] = match;

core.info(`matched "${match}"`);
core.info(`"${ref}" matched.`);
core.info(`scope: ${scope}`);
core.info(`name: ${name}`);
core.info(`major: ${major}`);
core.info(`minor: ${minor}`);
core.info(`patch: ${patch}`);
core.info(`prerelease: ${prerelease}`);
core.info(`build: ${build}`);

core.setOutput('matched', 'true');
core.setOutput('scope', scope);
Expand Down

0 comments on commit 0466824

Please sign in to comment.