From 7527338cdd87fc2e4616efb295323e4783790656 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 5 Feb 2024 15:05:35 +0100 Subject: [PATCH] ci: ask users to provide towncrier snippet And provide TL;DR documentation. --- .github/workflows/towncrier.yml | 42 ++++++++++++++++++++++++++++++++ docs/Release-Notes-New-Entry.md | 14 +++++++++-- towncrier.toml => pyproject.toml | 0 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/towncrier.yml rename towncrier.toml => pyproject.toml (100%) diff --git a/.github/workflows/towncrier.yml b/.github/workflows/towncrier.yml new file mode 100644 index 000000000..c05f332cb --- /dev/null +++ b/.github/workflows/towncrier.yml @@ -0,0 +1,42 @@ +--- +name: Check that ChangeLog has been modified + +on: + pull_request: + branches: + - main + +jobs: + changed_files: + runs-on: ubuntu-latest + name: Test that towncrier file exists + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v42 + with: + since_last_remote_commit: true + + - name: Detect the missing Release Notes entry + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: | + status=false + for file in ${ALL_CHANGED_FILES}; do + case $file in + *release-notes-next*) + status=true + ;; + esac + done + if $status; then + echo "Thank you for providing the release note snippet!" + else + echo "Please provide release notes snippet, per the instructions" + echo https://rpm-software-management.github.io/mock/Release-Notes-New-Entry + fi + $status diff --git a/docs/Release-Notes-New-Entry.md b/docs/Release-Notes-New-Entry.md index 044aee20a..1f5fd441e 100644 --- a/docs/Release-Notes-New-Entry.md +++ b/docs/Release-Notes-New-Entry.md @@ -3,11 +3,21 @@ layout: default title: Maintaining ChangeLog --- +# TL;DR + +Typical workflow: + + $ towncrier create failed-selinux-mountpoint.bugfix + Created news fragment at ./releng/release-notes-next/failed-selinux-mountpoint.bugfix + $ vim ./releng/release-notes-next/failed-selinux-mountpoint.bugfix + ... + $ git add ./releng/release-notes-next/failed-selinux-mountpoint.bugfix + # Maintaining ChangeLog Mock uses the [towncrier](https://github.com/twisted/towncrier) project for -maintaining release notes (aka changelog). For adding new entry, provide a text -file in +maintaining release notes (aka changelog). For adding new Release Notes entry, +provide a text file in [releng/release-notes-next](https://github.com/rpm-software-management/mock/tree/main/releng/release-notes-next) drop-in directory. diff --git a/towncrier.toml b/pyproject.toml similarity index 100% rename from towncrier.toml rename to pyproject.toml