From 40ffb7255f4f0445d5187428bd25e7d711415d62 Mon Sep 17 00:00:00 2001 From: JordonPhillips Date: Thu, 21 Nov 2024 18:22:35 +0100 Subject: [PATCH] Checkout base repo for changelog The changelog tool was checking out the branch repo. This was done to enable pushing, but since the tool no longer pushes, it's not necessary. --- .changes/tool/amend.py | 4 +++- .github/workflows/changelog-ci.yml | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.changes/tool/amend.py b/.changes/tool/amend.py index f1dd55d9dc2..e6259640927 100644 --- a/.changes/tool/amend.py +++ b/.changes/tool/amend.py @@ -71,13 +71,15 @@ def amend( def get_new_changes(base: str | None) -> dict[Path, Change]: base = base or os.environ.get("GITHUB_BASE_REF", "main") - print(f"Running a diff against base branch: {base}") + print(f"Running a diff against base branch: `{base}`\nHead commit:") + subprocess.run("git log -1", check=True, shell=True) result = subprocess.run( f"git diff origin/{base} --name-only", check=True, shell=True, capture_output=True, ) + print(f"Changed files:\n{result}") new_changes: dict[Path, Change] = {} for changed_file in result.stdout.decode("utf-8").splitlines(): diff --git a/.github/workflows/changelog-ci.yml b/.github/workflows/changelog-ci.yml index 61910ff6599..598a7f823f2 100644 --- a/.github/workflows/changelog-ci.yml +++ b/.github/workflows/changelog-ci.yml @@ -8,8 +8,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} - uses: actions/setup-python@v5 with: