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

If there's a {{ pr-build-summary }} in the PR description, update it. #1971

Merged
merged 4 commits into from
Apr 26, 2023
Merged
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
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ To get an auto-generated PR description you can put "copilot:summary" or "copilo
### Checklist
* [ ] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [ ] I've included a screenshot or gif (if applicable)

<!-- This line will get updated when the PR build summary job finishes. -->
PR Build Summary: {{ pr-build-summary }}
1 change: 1 addition & 0 deletions .github/workflows/reusable_pr_summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"

runs-on: ubuntu-latest

Expand Down
5 changes: 5 additions & 0 deletions scripts/generate_pr_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def generate_pr_summary(github_token: str, github_repository: str, pr_number: in
print("Uploading results to {}".format(upload_blob.name))
upload_blob.upload_from_file(buffer, content_type="text/html")

# If there's a {{ pr-build-summary }} string in the PR description, replace it with a link to the summary page.
pr_description = pull.body
new_description = pr_description.replace("{{ pr-build-summary }}", f"https://build.rerun.io/pr/{pr_number}")
pull.edit(body=new_description)


def main() -> None:
parser = argparse.ArgumentParser(description="Generate a PR summary page")
Expand Down