mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-27 22:06:03 +00:00
Merge branch 'master' of https://github.com/softprops/action-gh-release into feat/add-generateReleaseNotes
Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
commit
03a9aceb8e
2 changed files with 23 additions and 25 deletions
|
@ -1,13 +1,12 @@
|
||||||
import * as assert from "assert";
|
|
||||||
import {
|
import {
|
||||||
mimeOrDefault,
|
|
||||||
asset,
|
asset,
|
||||||
Releaser,
|
|
||||||
Release,
|
|
||||||
findTagFromReleases,
|
findTagFromReleases,
|
||||||
|
mimeOrDefault,
|
||||||
|
Release,
|
||||||
|
Releaser,
|
||||||
} from "../src/github";
|
} from "../src/github";
|
||||||
|
|
||||||
import { describe, it } from "vitest";
|
import { assert, describe, it } from "vitest";
|
||||||
|
|
||||||
describe("github", () => {
|
describe("github", () => {
|
||||||
describe("mimeOrDefault", () => {
|
describe("mimeOrDefault", () => {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as assert from "assert";
|
|
||||||
import {
|
import {
|
||||||
alignAssetName,
|
alignAssetName,
|
||||||
isTag,
|
isTag,
|
||||||
|
@ -10,16 +9,16 @@ import {
|
||||||
uploadUrl,
|
uploadUrl,
|
||||||
} from "../src/util";
|
} from "../src/util";
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { assert, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
describe("util", () => {
|
describe("util", () => {
|
||||||
describe("uploadUrl", () => {
|
describe("uploadUrl", () => {
|
||||||
it("strips template", () => {
|
it("strips template", () => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
uploadUrl(
|
uploadUrl(
|
||||||
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
|
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}"
|
||||||
),
|
),
|
||||||
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets",
|
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -33,7 +32,7 @@ describe("util", () => {
|
||||||
it("parses newline and comma-delimited (and then some)", () => {
|
it("parses newline and comma-delimited (and then some)", () => {
|
||||||
assert.deepStrictEqual(
|
assert.deepStrictEqual(
|
||||||
parseInputFiles("foo,bar\nbaz,boom,\n\ndoom,loom "),
|
parseInputFiles("foo,bar\nbaz,boom,\n\ndoom,loom "),
|
||||||
["foo", "bar", "baz", "boom", "doom", "loom"],
|
["foo", "bar", "baz", "boom", "doom", "loom"]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -58,7 +57,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("uses input body path", () => {
|
it("uses input body path", () => {
|
||||||
|
@ -81,7 +80,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("defaults to body path when both body and body path are provided", () => {
|
it("defaults to body path when both body and body path are provided", () => {
|
||||||
|
@ -104,7 +103,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -140,7 +139,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -168,7 +167,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("supports discussion category names", () => {
|
it("supports discussion category names", () => {
|
||||||
|
@ -195,7 +194,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -223,7 +222,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: true,
|
input_generate_release_notes: true,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -255,7 +254,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("uses input token as the source of GITHUB_TOKEN by default", () => {
|
it("uses input token as the source of GITHUB_TOKEN by default", () => {
|
||||||
|
@ -284,7 +283,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("parses basic config with draft and prerelease", () => {
|
it("parses basic config with draft and prerelease", () => {
|
||||||
|
@ -312,7 +311,7 @@ describe("util", () => {
|
||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("parses basic config where make_latest is passed", () => {
|
it("parses basic config where make_latest is passed", () => {
|
||||||
|
@ -339,7 +338,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: "false",
|
input_make_latest: "false",
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("parses basic config with append_body", () => {
|
it("parses basic config with append_body", () => {
|
||||||
|
@ -366,7 +365,7 @@ describe("util", () => {
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
input_previous_tag: undefined,
|
input_previous_tag: undefined,
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -383,7 +382,7 @@ describe("util", () => {
|
||||||
it("resolves files given a set of paths", async () => {
|
it("resolves files given a set of paths", async () => {
|
||||||
assert.deepStrictEqual(
|
assert.deepStrictEqual(
|
||||||
paths(["tests/data/**/*", "tests/data/does/not/exist/*"]),
|
paths(["tests/data/**/*", "tests/data/does/not/exist/*"]),
|
||||||
["tests/data/foo/bar.txt"],
|
["tests/data/foo/bar.txt"]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -392,7 +391,7 @@ describe("util", () => {
|
||||||
it("returns the patterns that don't match any files", async () => {
|
it("returns the patterns that don't match any files", async () => {
|
||||||
assert.deepStrictEqual(
|
assert.deepStrictEqual(
|
||||||
unmatchedPatterns(["tests/data/**/*", "tests/data/does/not/exist/*"]),
|
unmatchedPatterns(["tests/data/**/*", "tests/data/does/not/exist/*"]),
|
||||||
["tests/data/does/not/exist/*"],
|
["tests/data/does/not/exist/*"]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -404,7 +403,7 @@ describe("util", () => {
|
||||||
|
|
||||||
it("handles names with multiple spaces", () => {
|
it("handles names with multiple spaces", () => {
|
||||||
expect(alignAssetName("John William Doe.bla")).toBe(
|
expect(alignAssetName("John William Doe.bla")).toBe(
|
||||||
"John.William.Doe.bla",
|
"John.William.Doe.bla"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue