Skip to content

Commit cb3e795

Browse files
authored
Merge pull request #6 from crup/next
ci(release): avoid heredoc in workflow guard
2 parents fe8231b + fd4da78 commit cb3e795

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ jobs:
7979
if [ "$VERSION_BUMP" = "manual" ]; then
8080
STABLE_VERSION="$STABLE_VERSION_INPUT"
8181
else
82-
STABLE_VERSION="$(
83-
CURRENT_LATEST="$CURRENT_LATEST" VERSION_BUMP="$VERSION_BUMP" node - <<'NODE'
84-
const currentLatest = process.env.CURRENT_LATEST || '';
85-
const bump = process.env.VERSION_BUMP || 'patch';
82+
STABLE_VERSION="$(CURRENT_LATEST="$CURRENT_LATEST" VERSION_BUMP="$VERSION_BUMP" node -e '
83+
const currentLatest = process.env.CURRENT_LATEST || "";
84+
const bump = process.env.VERSION_BUMP || "patch";
8685
const match = currentLatest.match(/^(\d+)\.(\d+)\.(\d+)(?:-.+)?$/);
8786
let major = match ? Number(match[1]) : 0;
8887
let minor = match ? Number(match[2]) : 0;
@@ -94,20 +93,19 @@ jobs:
9493
patch = 1;
9594
} else if (isPrerelease) {
9695
// Promote the current prerelease base to stable, for example 0.0.1-next.18 -> 0.0.1.
97-
} else if (bump === 'major') {
96+
} else if (bump === "major") {
9897
major += 1;
9998
minor = 0;
10099
patch = 0;
101-
} else if (bump === 'minor') {
100+
} else if (bump === "minor") {
102101
minor += 1;
103102
patch = 0;
104103
} else {
105104
patch += 1;
106105
}
107106
108107
process.stdout.write(`${major}.${minor}.${patch}`);
109-
NODE
110-
)"
108+
')"
111109
fi
112110
113111
if ! printf '%s' "$STABLE_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then

0 commit comments

Comments
 (0)