From 428ad03eb9e27588f86bd982ec18f51e446e56ca Mon Sep 17 00:00:00 2001 From: Can Bulut Bayburt Date: Thu, 30 Nov 2023 17:26:50 +0100 Subject: [PATCH 1/2] Use 'git diff' to get the changed file list --- .github/workflows/changelogs.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/changelogs.yml b/.github/workflows/changelogs.yml index 18c08dfbfdc2..4e3c648c8887 100644 --- a/.github/workflows/changelogs.yml +++ b/.github/workflows/changelogs.yml @@ -49,7 +49,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 1 + fetch-depth: 2 - id: master name: Get modified master changelog files uses: Ana06/get-changed-files@v2.2.0 @@ -67,23 +67,23 @@ jobs: echo echo "See https://github.com/uyuni-project/uyuni/wiki/Contributing for a guide to writing changelogs." exit 1 - - id: changelogs - name: Get modified files - if: "!contains(github.event.pull_request.body, '[x] No changelog needed')" - uses: Ana06/get-changed-files@v2.2.0 - name: Test changelog entries env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} BZ_TOKEN: ${{ secrets.BUGZILLA_TOKEN }} run: | pip install python-bugzilla~=3.2.0 + + CHANGED_FILES=$(git diff --name-only \ + ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) + # Tracker file can be retrieved from the OBS/IBS API # by calling 'osc api /issue_trackers/' (with authentication) python .github/workflows/changelogs/changelogs.py \ --tracker-file .github/workflows/changelogs/trackers.xml \ --git-repo uyuni-project/uyuni \ --pr-number ${{ github.event.pull_request.number }} \ - ${{ steps.changelogs.outputs.all }} + $CHANGED_FILES # Warns the user if they merged the PR, but the changelog test failed warn_user_if_merged: From 396dbd285f2fbbb1bd63f5f7ba8dcac5b8f50bc2 Mon Sep 17 00:00:00 2001 From: Can Bulut Bayburt Date: Thu, 30 Nov 2023 17:28:21 +0100 Subject: [PATCH 2/2] Trigger changelog tests --- .github/workflows/changelogs.yml | 1 + java/myfile | 0 java/spacewalk-java.changes.asd | 21 +++++++++++++++++++++ java/spacewalk-java.changes.asd2 | 5 +++++ web/myfile | 0 web/spacewalk-web.changes.ax | 0 6 files changed, 27 insertions(+) create mode 100644 java/myfile create mode 100644 java/spacewalk-java.changes.asd create mode 100644 java/spacewalk-java.changes.asd2 create mode 100644 web/myfile create mode 100644 web/spacewalk-web.changes.ax diff --git a/.github/workflows/changelogs.yml b/.github/workflows/changelogs.yml index 4e3c648c8887..f3e54a40b297 100644 --- a/.github/workflows/changelogs.yml +++ b/.github/workflows/changelogs.yml @@ -5,6 +5,7 @@ on: types: [opened, edited, synchronize, reopened, closed] # Only execute on the main branches (feature branches are excluded) branches: + - changelog-action - master # Uyuni patches - 'Uyuni-[0-9]+.[0-9]+' diff --git a/java/myfile b/java/myfile new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/java/spacewalk-java.changes.asd b/java/spacewalk-java.changes.asd new file mode 100644 index 000000000000..a1b1e221fc5b --- /dev/null +++ b/java/spacewalk-java.changes.asd @@ -0,0 +1,21 @@ +- My changelog entry +- My very long changelog entry. My very long changelog entry. My very long changelog entry. My very long changelog entry. +- This is a + multi-line entry +- This is a multi-line entry +with wrong indentation + +- Another entry + - Entry with wrong indentation +- Entry with multiple whitespaces +- Mistyped tracker here (bsv#1231231) +- not capitalized +- This is a multi-line + entry with wrong + spacing after punctuation,characters +- Yet another entry +- Another mistyped tracker (sc#1231231) +- Entry with trailing whitespaces +- This is a multi-line + entry. with wrong + capitalization after a full stop. diff --git a/java/spacewalk-java.changes.asd2 b/java/spacewalk-java.changes.asd2 new file mode 100644 index 000000000000..75dbb7a61bde --- /dev/null +++ b/java/spacewalk-java.changes.asd2 @@ -0,0 +1,5 @@ +- My bugfix (bsc#1231231) with a multi-line + changelog entry +- Valid bug tracker (bsc#1216509) +- Valid bug trackers (bsc#1215813, bsc#1214463) +- Another valid bug tracker, according to IBS/OBS trackers (bnc#1216509) diff --git a/web/myfile b/web/myfile new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web/spacewalk-web.changes.ax b/web/spacewalk-web.changes.ax new file mode 100644 index 000000000000..e69de29bb2d1