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

Add reference to action in report #81

Merged
merged 3 commits into from
Jul 31, 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: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ disable=
too-few-public-methods,
duplicate-code,
too-many-locals,
too-many-branches,
too-many-branches,
line-too-long,
3 changes: 3 additions & 0 deletions markdown_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ def write_to_markdown(
if f"Time spent in {label}" in columns:
file.write(f" {issue.label_metrics[label]} |")
file.write("\n")
file.write(
"_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
)

print("Wrote issue metrics to issue_metrics.md")

Expand Down
3 changes: 3 additions & 0 deletions test_markdown_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def test_write_to_markdown(self):
"2 days, 0:00:00 | 3 days, 0:00:00 | 1 day, 0:00:00 |\n"
"| Issue 2 | https://github.com/user/repo/issues/2 | 3 days, 0:00:00 | "
"4 days, 0:00:00 | 5 days, 0:00:00 | 2 days, 0:00:00 |\n"
"_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
)
self.assertEqual(content, expected_content)
os.remove("issue_metrics.md")
Expand Down Expand Up @@ -158,6 +159,7 @@ def test_write_to_markdown_with_vertical_bar_in_title(self):
"2 days, 0:00:00 | 3 days, 0:00:00 | 1 day, 0:00:00 |\n"
"| feat| Issue 2 | https://github.com/user/repo/issues/2 | 3 days, 0:00:00 | "
"4 days, 0:00:00 | 5 days, 0:00:00 | 2 days, 0:00:00 |\n"
"_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
)
self.assertEqual(content, expected_content)
os.remove("issue_metrics.md")
Expand Down Expand Up @@ -257,6 +259,7 @@ def test_writes_markdown_file_with_non_hidden_columns_only(self):
"| --- | --- |\n"
"| Issue 1 | https://github.com/user/repo/issues/1 |\n"
"| Issue 2 | https://github.com/user/repo/issues/2 |\n"
"_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
)
self.assertEqual(content, expected_content)
os.remove("issue_metrics.md")