Skip to content

Commit 8dd9b24

Browse files
authored
Merge pull request #81 from github/action-reference
Add reference to action in report
2 parents 09be43d + 10fc810 commit 8dd9b24

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ disable=
55
too-few-public-methods,
66
duplicate-code,
77
too-many-locals,
8-
too-many-branches,
8+
too-many-branches,
9+
line-too-long,

markdown_writer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ def write_to_markdown(
149149
if f"Time spent in {label}" in columns:
150150
file.write(f" {issue.label_metrics[label]} |")
151151
file.write("\n")
152+
file.write(
153+
"_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
154+
)
152155

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

test_markdown_writer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def test_write_to_markdown(self):
8686
"2 days, 0:00:00 | 3 days, 0:00:00 | 1 day, 0:00:00 |\n"
8787
"| Issue 2 | https://github.com/user/repo/issues/2 | 3 days, 0:00:00 | "
8888
"4 days, 0:00:00 | 5 days, 0:00:00 | 2 days, 0:00:00 |\n"
89+
"_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
8990
)
9091
self.assertEqual(content, expected_content)
9192
os.remove("issue_metrics.md")
@@ -158,6 +159,7 @@ def test_write_to_markdown_with_vertical_bar_in_title(self):
158159
"2 days, 0:00:00 | 3 days, 0:00:00 | 1 day, 0:00:00 |\n"
159160
"| feat| Issue 2 | https://github.com/user/repo/issues/2 | 3 days, 0:00:00 | "
160161
"4 days, 0:00:00 | 5 days, 0:00:00 | 2 days, 0:00:00 |\n"
162+
"_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
161163
)
162164
self.assertEqual(content, expected_content)
163165
os.remove("issue_metrics.md")
@@ -257,6 +259,7 @@ def test_writes_markdown_file_with_non_hidden_columns_only(self):
257259
"| --- | --- |\n"
258260
"| Issue 1 | https://github.com/user/repo/issues/1 |\n"
259261
"| Issue 2 | https://github.com/user/repo/issues/2 |\n"
262+
"_This report was generated with the [Issue Metrics Action](https://github.com/github/issue-metrics)_\n"
260263
)
261264
self.assertEqual(content, expected_content)
262265
os.remove("issue_metrics.md")

0 commit comments

Comments
 (0)