forked from uyuni-project/uyuni
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GH action for enhanced changelog validation
- Loading branch information
Showing
4 changed files
with
1,380 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]+' | ||
|
@@ -44,7 +45,7 @@ on: | |
|
||
jobs: | ||
changelog_test: | ||
name: Test changelog entries | ||
name: Changelog tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -65,22 +66,27 @@ jobs: | |
echo " - $file" | ||
done | ||
echo | ||
echo "See https://github.com/uyuni-project/uyuni/wiki/Contributing for a guide to writing checklogs." | ||
echo "See https://github.com/uyuni-project/uyuni/wiki/Contributing for a guide to writing changelogs." | ||
exit 1 | ||
- id: changelogs | ||
name: Get modified changelog files | ||
name: Get modified files | ||
if: "!contains(github.event.pull_request.body, '[x] No changelog needed')" | ||
uses: Ana06/[email protected] | ||
with: | ||
filter: '*.changes.*' | ||
- name: Fail if no changelog entries are added | ||
if: steps.changelogs.conclusion == 'success' && steps.changelogs.outputs.added_modified == '' | ||
- name: Test changelog entries | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BZ_TOKEN: ${{ secrets.BUGZILLA_TOKEN }} | ||
run: | | ||
echo "No changelog entry found. Please add the required changelog entries." | ||
echo "See https://github.com/uyuni-project/uyuni/wiki/Contributing for a guide to writing checklogs." | ||
exit 1 | ||
pip install python-bugzilla~=3.2.0 | ||
# 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 }} | ||
# warns the user if they merged the PR, but the changelog test failed | ||
# Warns the user if they merged the PR, but the changelog test failed | ||
warn_user_if_merged: | ||
name: Warn user if merged | ||
if: always() && github.event.action == 'closed' && github.event.pull_request.merged == true && needs.changelog_test.result == 'failure' | ||
|
Oops, something went wrong.