From 7f628d63b2ea488f7ff7ccfdc932802c70c38972 Mon Sep 17 00:00:00 2001 From: Can Bulut Bayburt Date: Sun, 24 Nov 2024 19:21:48 +0100 Subject: [PATCH] Use gh CLI to get the PR diff This enables the workflow to get the changed file list when run on `pull_request_target` event --- .github/workflows/changelogs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelogs.yml b/.github/workflows/changelogs.yml index 8c50ad9667e..218dbd5e280 100644 --- a/.github/workflows/changelogs.yml +++ b/.github/workflows/changelogs.yml @@ -75,8 +75,9 @@ jobs: 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 }}) + CHANGED_FILES=$(gh pr diff -R ${{ github.event.pull_request.base.repo.full_name }} \ + ${{ github.event.pull_request.number }} --name-only) + echo $CHANGED_FILES # Tracker file can be retrieved from the OBS/IBS API # by calling 'osc api /issue_trackers/' (with authentication)