Skip to content

Commit

Permalink
Checkout base repo for changelog
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JordonPhillips committed Nov 21, 2024
1 parent 50fa20e commit b365e3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .changes/tool/amend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.stdout}")

new_changes: dict[Path, Change] = {}
for changed_file in result.stdout.decode("utf-8").splitlines():
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/changelog-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b365e3a

Please sign in to comment.