Unverified Commit 234b8e6c authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Add max length check for changelog entries (#2896)

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 6190248f
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -146,10 +146,16 @@ impl HandAuthoredEntry {
        if !self.author.chars().all(|c| c.is_alphanumeric() || c == '-') {
            bail!("Author must be valid GitHub username: [a-zA-Z0-9\\-]")
        }
        // TODO(enableNewSmithyRuntimeCleanup): Re-add this validation
        // if self.references.is_empty() {
        //     bail!("Changelog entry must refer to at least one pull request or issue");
        // }
        if self.references.is_empty() {
            bail!("Changelog entry must refer to at least one pull request or issue");
        }
        if self.message.len() > 800 {
            bail!(
                "Your changelog entry is too long. Post long-form change log entries in \
                the GitHub Discussions under the Changelog category, and link to them from \
                the changelog."
            );
        }

        Ok(())
    }