mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-25 15:22:59 +00:00
@@ -29,7 +29,7 @@ Create a workflow file in your .github/workflows directory as follows:
|
|||||||
|
|
||||||
### workflow.yaml
|
### workflow.yaml
|
||||||
|
|
||||||
Latest version is `v2.0`.
|
Latest version is `v2.1`.
|
||||||
|
|
||||||
name: "Workflow"
|
name: "Workflow"
|
||||||
on: ["push"]
|
on: ["push"]
|
||||||
@@ -75,7 +75,7 @@ This will create an issue called "Come up with a more imaginative greeting".
|
|||||||
|
|
||||||
**The action expects a colon and/or space to follow the `TODO` label (so `TODO: ` or just `TODO`).**
|
**The action expects a colon and/or space to follow the `TODO` label (so `TODO: ` or just `TODO`).**
|
||||||
|
|
||||||
Should the title be longer than 50 characters, it will be truncated for the issue title.
|
Should the title be longer than 80 characters, it will be truncated for the issue title.
|
||||||
|
|
||||||
The full title will be included in the issue body and a `todo` label will be attached to the issue.
|
The full title will be included in the issue body and a `todo` label will be attached to the issue.
|
||||||
|
|
||||||
|
|||||||
6
main.py
6
main.py
@@ -184,9 +184,9 @@ def main():
|
|||||||
print('Start creating issues')
|
print('Start creating issues')
|
||||||
for i, issue in enumerate(new_issues):
|
for i, issue in enumerate(new_issues):
|
||||||
title = issue['todo']
|
title = issue['todo']
|
||||||
# Truncate the title if it's longer than 50 chars.
|
# Truncate the title if it's longer than 80 chars.
|
||||||
if len(title) > 50:
|
if len(title) > 80:
|
||||||
title = title[:50] + '...'
|
title = title[:80] + '...'
|
||||||
file = issue['file']
|
file = issue['file']
|
||||||
line = issue['line_num']
|
line = issue['line_num']
|
||||||
body = issue['body'] + '\n\n' + f'https://github.com/{repo}/blob/{sha}/{file}#L{line}'
|
body = issue['body'] + '\n\n' + f'https://github.com/{repo}/blob/{sha}/{file}#L{line}'
|
||||||
|
|||||||
Reference in New Issue
Block a user