Skip to content

Commit

Permalink
Merge pull request #81 from github/action-reference
Browse files Browse the repository at this point in the history
Add reference to action in report
  • Loading branch information
zkoppert authored Jul 31, 2023
2 parents 09be43d + 10fc810 commit 8dd9b24
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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")

0 comments on commit 8dd9b24

Please sign in to comment.