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.
squash! Use gh CLI to get the PR diff
- Loading branch information
Showing
1 changed file
with
18 additions
and
7 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 |
---|---|---|
|
@@ -48,9 +48,18 @@ jobs: | |
name: Changelog tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Clone PR head branch | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
HEAD_REPO: ${{ github.event.pull_request.head.repo.clone_url }} | ||
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }} | ||
run: | | ||
#echo "Cloning head branch from $HEAD_REPO" | ||
#git clone --branch $HEAD_BRANCH $HEAD_REPO head-branch | ||
#cd head-branch | ||
gh pr checkout ${{ github.event.pull_request.number }} | ||
echo "Latest commit:" | ||
git log -1 | ||
- id: master | ||
name: Get modified master changelog files | ||
uses: Ana06/[email protected] | ||
|
@@ -68,24 +77,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/[email protected] | ||
- 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: | ||
|