Skip to content

Commit

Permalink
Run the workflow from the base ref instead of head
Browse files Browse the repository at this point in the history
  • Loading branch information
cbbayburt committed Nov 26, 2024
1 parent 7c265fa commit 2343e38
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/changelogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- id: master
name: Get modified master changelog files
uses: Ana06/get-changed-files@v2.3.0
Expand All @@ -68,8 +67,15 @@ jobs:
echo
echo "See https://github.com/uyuni-project/uyuni/wiki/Contributing for a guide to writing changelogs."
exit 1
- name: Test changelog entries
- name: Checkout the HEAD branch
if: "!contains(github.event.pull_request.body, '[x] No changelog needed')"
# Check out the PR HEAD in a subdirectory to read the changed files for tests
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
path: .head
- name: Test changelog entries
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BZ_TOKEN: ${{ secrets.BUGZILLA_TOKEN }}
Expand All @@ -83,7 +89,7 @@ jobs:
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
--tracker-file $TRACKER_FILE --git-repo $GIT_REPO --uyuni-root .head --pr-number $PR_NUM $CHANGED_FILES
# Warns the user if they merged the PR, but the changelog test failed
warn_user_if_merged:
Expand Down

0 comments on commit 2343e38

Please sign in to comment.