Small Changelog Generation Fixes (#792)

[FIXUP]
[[fixes]]
sha = "bf4055fbe4092d72f68bb40bb5d88c624ce5b074"
changeFixes = false
newBody = '''
[EXPAND]
  [[messages]]
  messageTitle = "Upgrade AE2 Stuff to AE2 Stuff Unofficial"
  messageBody = """
    [BREAKING]
    [DETAILS]
      details = [
        \"Pattern Encoders have been Removed!\",
        \"Any existing Pattern Encoders, whether items, in patterns or placed, have been remapped to AE2 Interfaces.\",
        \"All Usages in Recipes have also been changed to AE2 Interfaces!\",
      ]
    [DETAILS]
    [PRIORITY]
      priority = 25
    [PRIORITY]
  """
  
  [[messages]]
  messageTitle = "Update GT to 2.8.10"
  messageBody = """
    [BREAKING]
    [DETAILS]
      details = [
        \"Allows GregTech Data Sticks to Copy ME Hatch Settings\",
        \"Adds an 'Stocking' Version of ME Hatches and Buses\",
        \"Support for Displaying Power Substation on Central Monitor\",
      ]
    [DETAILS]
    [PRIORITY]
      priority = 20
    [PRIORITY]
    [IGNORE]
      checks = { compareBefore = \"1.7-alpha-4\" } # Only apply this if the commit being compared against is 1.7-alpha-4 or newer
    [IGNORE]
  """
  
  [[messages]]
  messageTitle = "Update Nomi Labs to 0.7.0"
  messageBody = """
    [BREAKING]
    [DETAILS]
      details = [
        \"Improvement of DME Simulation Chamber (now increases Tiers and Data Counts of Models)\",
        \"Custom Implementation of Difficulty Lock, now works on Dedicated Servers\",
        \"Replacement of the Void Dimension, fixing issues with Difficulty Changing\",
        \"Replacement of Custom Window Titles and Logos, Allowing the Removal of Random Patches\",
        \"Improvements to FTB Utils and Effortless Building\",
        \"Allows Setting of Default Keybinds for New Players\",
      ]
    [DETAILS]
    [PRIORITY]
      priority = 15
    [PRIORITY]
    [IGNORE]
      checks = { compareBefore = \"1.7-alpha-4\" } # Only apply this if the commit being compared against is 1.7-alpha-4 or newer
    [IGNORE]
  """
[EXPAND]
'''
[FIXUP]

[MOD INFO]
  [[infos]]
  projectID = 254317
  info = "Replaced by Nomi Labs"

  [[infos]]
  projectID = 285612
  info = "Replaced by Nomi Labs"
  
  [[infos]]
  projectID = 390886
  info = "Replaced by Nomi Labs"
  
  [[infos]]
  projectID = 538092
  info = "Replaced by Betterer P2P"
[MOD INFO]
This commit is contained in:
Integer Limit 2024-07-11 21:54:46 +10:00 committed by GitHub
parent bf4055fbe4
commit 9e2fd51b8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 7 deletions

View File

@ -108,6 +108,9 @@ export async function parseCommitBody(
commitObject: Commit, commitObject: Commit,
parser: Parser, parser: Parser,
): Promise<boolean | Ignored> { ): Promise<boolean | Ignored> {
if (commitBody.includes(modInfoKey))
await parseModInfo(commitBody, commitObject);
if (commitBody.includes(expandKey)) { if (commitBody.includes(expandKey)) {
await parseExpand(commitBody, commitObject, parser); await parseExpand(commitBody, commitObject, parser);
return true; return true;
@ -132,8 +135,6 @@ export async function parseCommitBody(
commitObject.priority = newPriority; commitObject.priority = newPriority;
} }
if (commitBody.includes(modInfoKey))
await parseModInfo(commitBody, commitObject);
if (commitBody.includes(detailsKey)) { if (commitBody.includes(detailsKey)) {
await parseDetails(commitMessage, commitBody, commitObject, parser); await parseDetails(commitMessage, commitBody, commitObject, parser);
return true; return true;

View File

@ -8,6 +8,12 @@ import { getIssueURL, getNewestIssueURLs } from "#utils/util.ts";
let data: ChangelogData; let data: ChangelogData;
let octokit: Octokit; let octokit: Octokit;
// How many lines the changelog (excluding the commit log) can be before the commit log is excluded.
const sectionLinesBeforeCommitLogExcluded = 50;
// How many lines the commit log can be before its is excluded.
const logLinesBeforeCommitLogExcluded = 20;
export default async function pushAll(inputData: ChangelogData): Promise<void> { export default async function pushAll(inputData: ChangelogData): Promise<void> {
pushTitle(inputData); pushTitle(inputData);
await pushChangelog(inputData); await pushChangelog(inputData);
@ -65,12 +71,17 @@ export async function pushChangelog(inputData: ChangelogData): Promise<void> {
// Push the commit log // Push the commit log
if (data.commitList.length > 0) { if (data.commitList.length > 0) {
sortCommitList(data.commitList, (commit) => commit); if (
data.builder.length < sectionLinesBeforeCommitLogExcluded &&
data.commitList.length < logLinesBeforeCommitLogExcluded
) {
sortCommitList(data.commitList, (commit) => commit);
data.builder.push("## Commits"); data.builder.push("## Commits");
data.commitList.forEach((commit) => { data.commitList.forEach((commit) => {
data.builder.push(formatCommit(commit)); data.builder.push(formatCommit(commit));
}); });
}
} else { } else {
// No Commit List = No Changes // No Commit List = No Changes
data.builder.push(""); data.builder.push("");