Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
8 changes: 5 additions & 3 deletions github_activity/github_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,11 @@ def filter_ignored(userlist):
this_md = f"- {ititle} [#{irowdata['number']}]({irowdata['url']}) ({contributor_list})"
items["md"].append(this_md)

# Get functional GitHub references: any git reference or master@{YY-mm-dd}
# Get functional GitHub references: any git reference or {branch}@{YY-mm-dd}
# Use the branch parameter if provided, otherwise default to "main"
ref_branch = branch or "main"
if closed_prs.size > 0 and not data.since_is_git_ref:
since = f"master@{{{data.since_dt:%Y-%m-%d}}}"
since = f"{ref_branch}@{{{data.since_dt:%Y-%m-%d}}}"
closest_date_start = closed_prs.loc[
abs(
pd.to_datetime(closed_prs["closedAt"], utc=True)
Expand All @@ -704,7 +706,7 @@ def filter_ignored(userlist):
since_ref = since

if closed_prs.size > 0 and not data.until_is_git_ref:
until = f"master@{{{data.until_dt:%Y-%m-%d}}}"
until = f"{ref_branch}@{{{data.until_dt:%Y-%m-%d}}}"
closest_date_stop = closed_prs.loc[
abs(
pd.to_datetime(closed_prs["closedAt"], utc=True)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
),
# CLI with default branch
(
"github-activity {org}/{repo} -s 2021-01-01 -u 2021-01-15 -o {path_output} -b master",
"github-activity {org}/{repo} -s 2021-01-01 -u 2021-01-15 -o {path_output} -b main",
"cli_def_branch",
),
# CLI with no target
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli/cli_def_branch.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# master@{2021-01-01}...master@{2021-01-15}
# main@{2021-01-01}...main@{2021-01-15}

([full changelog](https://github.com/executablebooks/github-activity/compare/c740a454def057304556675ce7694dc0f2eb6c88...c740a454def057304556675ce7694dc0f2eb6c88))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli/cli_no_target.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# master@{2021-01-01}...master@{2021-01-15}
# main@{2021-01-01}...main@{2021-01-15}

([full changelog](https://github.com/executablebooks/github-activity/compare/c740a454def057304556675ce7694dc0f2eb6c88...c740a454def057304556675ce7694dc0f2eb6c88))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli/cli_no_target_pyproject.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##### master@{2021-01-01}...master@{2021-01-15}
##### main@{2021-01-01}...main@{2021-01-15}

([full changelog](https://github.com/executablebooks/github-activity/compare/c740a454def057304556675ce7694dc0f2eb6c88...c740a454def057304556675ce7694dc0f2eb6c88))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli/cli_w_parts.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# master@{2021-01-01}...master@{2021-01-15}
# main@{2021-01-01}...main@{2021-01-15}

([full changelog](https://github.com/executablebooks/github-activity/compare/c740a454def057304556675ce7694dc0f2eb6c88...c740a454def057304556675ce7694dc0f2eb6c88))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli/cli_w_url.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# master@{2021-01-01}...master@{2021-01-15}
# main@{2021-01-01}...main@{2021-01-15}

([full changelog](https://github.com/executablebooks/github-activity/compare/c740a454def057304556675ce7694dc0f2eb6c88...c740a454def057304556675ce7694dc0f2eb6c88))

Expand Down
Loading