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 f7306ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 14 additions & 7 deletions .changes/tool/amend.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,20 @@ 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}")
result = subprocess.run(
f"git diff origin/{base} --name-only",
check=True,
shell=True,
capture_output=True,
)
print(f"Running a diff against base branch: `{base}`")

try:
result = subprocess.run(
f"git diff --name-only origin/{base}",
check=True,
shell=True,
capture_output=True,
)
except subprocess.CalledProcessError as e:
print(f"stdout: {e.stdout.decode("utf-8")}\n\nstderr: {e.stderr.decode("utf-i")}")
raise

print(f"Changed files:\n{result.stdout.decode("utf-8")}")

new_changes: dict[Path, Change] = {}
for changed_file in result.stdout.decode("utf-8").splitlines():
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/changelog-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- uses: actions/setup-python@v5
with:
Expand Down

0 comments on commit f7306ac

Please sign in to comment.