Skip to content

Commit

Permalink
squash! Use gh CLI to get the PR diff
Browse files Browse the repository at this point in the history
  • Loading branch information
cbbayburt committed Nov 24, 2024
1 parent cbd2730 commit 2022d0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/changelogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,26 @@ jobs:
echo
echo "See https://github.com/uyuni-project/uyuni/wiki/Contributing for a guide to writing changelogs."
exit 1
- id: files
name: Get changed files
uses: Ana06/get-changed-files@v2.3.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=$(gh pr diff -R ${{ github.event.pull_request.base.repo.full_name }} \
${{ github.event.pull_request.number }} --name-only)
echo $CHANGED_FILES
echo "Changed files:"
echo ${{ steps.files.outputs.added_modified }}
# Tracker file can be retrieved from the OBS/IBS API
# by calling 'osc api /issue_trackers/' (with authentication)
python .github/workflows/changelogs/changelogs.py -v \
--tracker-file .github/workflows/changelogs/trackers.xml \
--git-repo uyuni-project/uyuni \
--pr-number ${{ github.event.pull_request.number }} \
$CHANGED_FILES
${{ steps.files.outputs.added_modified }}
# Warns the user if they merged the PR, but the changelog test failed
warn_user_if_merged:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/changelogs/changelogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ def get_modified_files_for_pkg(self, pkg_path: str, pkg_name: str, files: list[s
# Check if the file exists in a subdirectory of the base path of the package
if os.path.normpath(os.path.dirname(f)).startswith(os.path.normpath(pkg_path)):
if os.path.basename(f).startswith(pkg_name + ".changes."):
# Ignore if the change is a removal
if os.path.isfile(os.path.join(self.uyuni_root, f)):
pkg_chlogs.append(f)
pkg_chlogs.append(f)
else:
pkg_files.append(f)

Expand Down

0 comments on commit 2022d0a

Please sign in to comment.