Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout base repo for changelog #2473

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading