mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 09:23:44 +03:00
release notes vN (#11077)
Make it more likely the draft release notes work... Release Notes: - N/A
This commit is contained in:
parent
8e925bf58f
commit
848bb97ba7
@ -27,13 +27,18 @@ async function main() {
|
||||
if (parts[2] == 0) {
|
||||
priorVersion = [parts[0], parts[1] - 1, 0].join(".");
|
||||
}
|
||||
} else if (!tagExists("v${priorVersion}")) {
|
||||
} else if (!ensureTag(`v${priorVersion}`)) {
|
||||
console.log("Copy the release notes from preview.");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
let [tag, priorTag] = [`v${version}${suffix}`, `v${priorVersion}${suffix}`];
|
||||
|
||||
if (!ensureTag(tag) || !ensureTag(priorTag)) {
|
||||
console.log("Could not draft release notes, missing a tag:", tag, priorTag);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const newCommits = getCommits(priorTag, tag);
|
||||
|
||||
let releaseNotes = [];
|
||||
@ -99,11 +104,17 @@ function getCommits(oldTag, newTag) {
|
||||
return pullRequestNumbers;
|
||||
}
|
||||
|
||||
function tagExists(tag) {
|
||||
function ensureTag(tag) {
|
||||
try {
|
||||
execFileSync("git", ["rev-parse", "--verify", tag]);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
try {
|
||||
execFileSync("git"[("fetch", "origin", "--shallow-exclude", tag)]);
|
||||
execFileSync("git"[("fetch", "origin", "--deepen", "1")]);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user