Skip to content

Commit

Permalink
Add webiste column to PR body
Browse files Browse the repository at this point in the history
  • Loading branch information
legoguy1000 committed Jan 23, 2025
1 parent 3f615cc commit b6cdc26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions vendor-update/pr-template.j2
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
The following vendor dependencies have been updated.

| Vendor | Change |
|---|---|
| Vendor | Change | Website |
|---|---|---|
{% for item in deps -%}
| {{ item.name }} | {{ item.old_version }} -> {{ item.new_version }} |
| {{ item.name }} | {{ item.old_version }} -> {{ item.new_version }} | [{{ item.website }}]({{ item.website }}) |
{% endfor %}

- [ ] This PR has been deployed and tested to the robot to confirm functionality?
6 changes: 5 additions & 1 deletion vendor-update/vendor-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def compareVersions(item1: str, item2: str):
print("Could not determine current WPILIB version")
sys.exit(1)
wpilib_repo = g.get_repo("wpilibsuite/allwpilib")
wpilib_latest_version = wpilib_repo.get_latest_release().tag_name.replace("v", "")
wpilib_latest_release = wpilib_repo.get_latest_release()
wpilib_latest_version = wpilib_latest_release.tag_name.replace("v", "")
if parse(wpilib_latest_version) > parse(
wpilib_version
) and wpilib_latest_version.startswith(projectYear):
Expand All @@ -107,6 +108,7 @@ def compareVersions(item1: str, item2: str):
"name": "WPILib",
"old_version": wpilib_version,
"new_version": wpilib_latest_version,
"website": f"{wpilib_latest_release.html_url}",
}
)
PR_TITLE.append("WPILib")
Expand Down Expand Up @@ -137,6 +139,7 @@ def compareVersions(item1: str, item2: str):
"name": name,
"old_version": version,
"new_version": new_version,
"website": new_vendor.get("website"),
}
)
url = new_vendor.get("path", "")
Expand Down Expand Up @@ -168,6 +171,7 @@ def compareVersions(item1: str, item2: str):
)
with open(SCRIPT_PATH.joinpath("pr-template.j2")) as f:
body = Template(f.read()).render(deps=UPDATED_DEPS)
print(body)
title = f"{" and ".join(PR_TITLE)} Updates"
if pulls.totalCount == 0:
gh_repo.create_pull(
Expand Down

0 comments on commit b6cdc26

Please sign in to comment.