forked from uyuni-project/uyuni
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request uyuni-project#9512 from cbbayburt/changelog-action
Changelog action: Fixes after test runs
- Loading branch information
Showing
3 changed files
with
74 additions
and
18 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 |
---|---|---|
|
@@ -50,7 +50,8 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
# Checkout only workflow code | ||
sparse-checkout: '.github/workflows' | ||
- id: master | ||
name: Get modified master changelog files | ||
uses: Ana06/[email protected] | ||
|
@@ -68,7 +69,17 @@ jobs: | |
echo | ||
echo "See https://github.com/uyuni-project/uyuni/wiki/Contributing for a guide to writing changelogs." | ||
exit 1 | ||
- name: Checkout the HEAD branch | ||
id: checkout | ||
if: "!contains(github.event.pull_request.body, '[x] No changelog needed')" | ||
# Check out the PR HEAD in a subdirectory to read the updated changelog files | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
path: .head | ||
- name: Test changelog entries | ||
if: steps.checkout.outcome == 'success' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BZ_TOKEN: ${{ secrets.BUGZILLA_TOKEN }} | ||
|
@@ -80,9 +91,9 @@ jobs: | |
run: | | ||
pip install python-bugzilla~=3.2.0 | ||
CHANGED_FILES=$(gh pr diff -R $GIT_REPO $PR_NUM --name-only) | ||
python .github/workflows/changelogs/changelogs.py \ | ||
--tracker-file $TRACKER_FILE --git-repo $GIT_REPO --pr-number $PR_NUM $CHANGED_FILES | ||
CHANGED_FILES=$(gh api --paginate repos/$GIT_REPO/pulls/$PR_NUM/files | jq -r '.[].filename') | ||
python .github/workflows/changelogs/changelogs.py ${RUNNER_DEBUG:+--verbose} \ | ||
--tracker-file $TRACKER_FILE --git-repo $GIT_REPO --uyuni-dir .head --pr-number $PR_NUM $CHANGED_FILES | ||
# Warns the user if they merged the PR, but the changelog test failed | ||
warn_user_if_merged: | ||
|
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
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