Skip to content

Commit 3a79558

Browse files
committed
fix: dont fetch tags if tags arg is empty array
1 parent f502f89 commit 3a79558

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ jobs:
2020
runs-on: ubuntu-20.04
2121
steps:
2222
- uses: actions/checkout@v3
23-
with:
24-
fetch-depth: 0
23+
2524
- uses: actions/setup-node@v3
2625
with:
2726
node-version: 16
@@ -40,8 +39,7 @@ jobs:
4039
runs-on: ${{ matrix.os }}
4140
steps:
4241
- uses: actions/checkout@v3
43-
with:
44-
fetch-depth: 0
42+
4543
- uses: actions/setup-node@v3
4644
with:
4745
node-version: ${{ matrix.node-version }}

lib/git.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { execaSync } from "execa";
1212
* @internal
1313
*/
1414
function getTags(branch, execaOptions, filters) {
15-
let tags = execaSync("git", ["tag", "--merged", branch], execaOptions).stdout;
15+
let tags = execaSync("git", ["tag", "--merged"], execaOptions).stdout;
1616
tags = tags
1717
.split("\n")
1818
.map((tag) => tag.trim())

lib/updateDeps.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ const getNextPreVersion = (pkg, tags) => {
5858
// 3. Resolve the versions from the tags
5959
// TODO: replace {cwd: '.'} with multiContext.cwd
6060
if (pkg.name) tagFilters.push(pkg.name);
61-
if (!tags || !tags.length) {
62-
tags = getTags(pkg._branch, { cwd: "." }, tagFilters);
61+
if (!tags) {
62+
tags = getTags(pkg._branch, { cwd: process.cwd() }, tagFilters);
6363
}
6464

6565
const lastPreRelTag = getPreReleaseTag(lastVersion);

test/bin/cli.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe("multi-semantic-release CLI", () => {
3535
// expect(out).toMatch("Released 4 of 4 packages, semantically!");
3636

3737
try {
38-
await execa("node", [filepath, "-- --no-sequential-prepare --no-ci"], { cwd });
38+
await execa("node", [filepath, "-- --no-sequential-prepare", "--no-ci"], { cwd });
3939
} catch (res) {
4040
const { stdout, stderr, exitCode } = res;
4141

@@ -58,7 +58,7 @@ describe("multi-semantic-release CLI", () => {
5858

5959
// Run via command line.
6060
const out = (
61-
await execa("node", [filepath, "-- --ignore-packages=packages/c/**,packages/d/** --no-ci"], { cwd })
61+
await execa("node", [filepath, "-- --ignore-packages=packages/c/**,packages/d/**", "--no-ci"], { cwd })
6262
).stdout;
6363
expect(out).toMatch("Started multirelease! Loading 2 packages...");
6464
expect(out).toMatch("Released 2 of 2 packages, semantically!");

0 commit comments

Comments
 (0)