Skip to content

Commit

Permalink
Accept release number as well as tag
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Apr 12, 2023
1 parent 0a0009e commit 5bff200
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build-support/bin/contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def create_parser() -> argparse.ArgumentParser:
def main() -> None:
args = create_parser().parse_args()
if args.since:
print(" " + "\n ".join(sorted_contributors(range=f"{args.since}..HEAD")))
tag = args.since
if not tag_exists(tag):
tag = f"release_{tag}"
print(" " + "\n ".join(sorted_contributors(range=f"{tag}..HEAD")))
else:
update_contributors_md()

Expand All @@ -46,5 +49,9 @@ def update_contributors_md() -> None:
)


def tag_exists(tag):
return subprocess.run(["git", "rev-parse", tag + "^{tag}"], capture_output=True).returncode == 0


if __name__ == "__main__":
main()

0 comments on commit 5bff200

Please sign in to comment.