diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index e0c41f0116..9250eaf524 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -6,6 +6,12 @@ on: - ".github/workflows/changelog.yml" - "CHANGELOG.md" - "xtask/**/*" + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled env: # @@ -38,6 +44,7 @@ jobs: with: fetch-depth: 0 + # NOTE: Keep label name(s) in sync. with `xtask`'s implementation. - name: Run `cargo xtask changelog …` run: | - cargo xtask changelog "origin/${{ github.event.pull_request.base.ref }}" + cargo xtask changelog "origin/${{ github.event.pull_request.base.ref }}" ${{ contains(github.event.pull_request.labels.*.name, 'changelog: released entry changed') && '--allow-released-changes' || '' }} diff --git a/xtask/src/changelog.rs b/xtask/src/changelog.rs index 09c1990b58..6143917fe1 100644 --- a/xtask/src/changelog.rs +++ b/xtask/src/changelog.rs @@ -6,6 +6,7 @@ use xshell::Shell; pub(crate) fn check_changelog(shell: Shell, mut args: Arguments) -> anyhow::Result<()> { const CHANGELOG_PATH_RELATIVE: &str = "./CHANGELOG.md"; + let allow_released_changes = args.contains("--allow-released-changes"); let from_branch = args .free_from_str() @@ -72,7 +73,12 @@ pub(crate) fn check_changelog(shell: Shell, mut args: Arguments) -> anyhow::Resu "one or more checks against `{}` failed; see above for details", CHANGELOG_PATH_RELATIVE, ); - Err(anyhow::Error::msg(msg)) + if allow_released_changes { + log::warn!("{msg}"); + Ok(()) + } else { + Err(anyhow::Error::msg(msg)) + } } else { Ok(()) } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index e5e0200aef..36c1227e35 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -53,6 +53,8 @@ Commands: `` is the tip of the `git diff` that will be used for checking (1). + --allow-released-changes Only reports issues as warnings, rather than reporting errors and forcing a non-zero exit code. + miri Run all miri-compatible tests under miri. Requires a nightly toolchain with the x86_64-unknown-linux-gnu target and miri component installed.