You've already forked wakapi-readme-stats
Merge pull request #300 from yanyongyu/feat/custom-committer
Feature: Add custom committer option and docs
This commit is contained in:
@@ -121,7 +121,11 @@ jobs:
|
|||||||
|
|
||||||
`COMMIT_BY_ME` flag can be set to `True` to commit the code using your name and email
|
`COMMIT_BY_ME` flag can be set to `True` to commit the code using your name and email
|
||||||
|
|
||||||
`COMMIT_MESSAGE` flag can be to set message commit, default is "Updated with Dev Metrics"
|
`COMMIT_MESSAGE` flag can be set to message commit, default is "Updated with Dev Metrics"
|
||||||
|
|
||||||
|
`COMMIT_USERNAME` flag can be set to username to commit the code, default is "readme-bot"
|
||||||
|
|
||||||
|
`COMMIT_EMAIL` flag can be set to email to commit the code, default is "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
`SHOW_UPDATED_DATE` flag can be set to `True` to show updated date in end of paragraph
|
`SHOW_UPDATED_DATE` flag can be set to `True` to show updated date in end of paragraph
|
||||||
|
|
||||||
@@ -432,4 +436,3 @@ Made with :heart: and Python 🐍.
|
|||||||
## Stargazers over time
|
## Stargazers over time
|
||||||
|
|
||||||
[](https://starchart.cc/anmol098/waka-readme-stats)
|
[](https://starchart.cc/anmol098/waka-readme-stats)
|
||||||
|
|
||||||
|
|||||||
10
action.yml
10
action.yml
@@ -92,6 +92,16 @@ inputs:
|
|||||||
description: "Git commit message"
|
description: "Git commit message"
|
||||||
default: "Updated with Dev Metrics"
|
default: "Updated with Dev Metrics"
|
||||||
|
|
||||||
|
COMMIT_USERNAME:
|
||||||
|
required: false
|
||||||
|
description: "Git commit custom username"
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
COMMIT_EMAIL:
|
||||||
|
required: false
|
||||||
|
description: "Git commit custom email"
|
||||||
|
default: ""
|
||||||
|
|
||||||
SHOW_UPDATED_DATE:
|
SHOW_UPDATED_DATE:
|
||||||
required: false
|
required: false
|
||||||
description: "Show updated date"
|
description: "Show updated date"
|
||||||
|
|||||||
7
main.py
7
main.py
@@ -48,6 +48,8 @@ ignored_repos_name = str(os.getenv('INPUT_IGNORED_REPOS') or '').replace(' ', ''
|
|||||||
show_updated_date = os.getenv('INPUT_SHOW_UPDATED_DATE')
|
show_updated_date = os.getenv('INPUT_SHOW_UPDATED_DATE')
|
||||||
updated_date_format = os.getenv('INPUT_UPDATED_DATE_FORMAT')
|
updated_date_format = os.getenv('INPUT_UPDATED_DATE_FORMAT')
|
||||||
commit_message = os.getenv('INPUT_COMMIT_MESSAGE')
|
commit_message = os.getenv('INPUT_COMMIT_MESSAGE')
|
||||||
|
commit_username = os.getenv('INPUT_COMMIT_USERNAME')
|
||||||
|
commit_email = os.getenv('INPUT_COMMIT_EMAIL')
|
||||||
show_total_code_time = os.getenv('INPUT_SHOW_TOTAL_CODE_TIME')
|
show_total_code_time = os.getenv('INPUT_SHOW_TOTAL_CODE_TIME')
|
||||||
symbol_version = os.getenv('INPUT_SYMBOL_VERSION').strip()
|
symbol_version = os.getenv('INPUT_SYMBOL_VERSION').strip()
|
||||||
show_waka_stats = 'y'
|
show_waka_stats = 'y'
|
||||||
@@ -565,7 +567,10 @@ if __name__ == '__main__':
|
|||||||
if commit_by_me.lower() in truthy:
|
if commit_by_me.lower() in truthy:
|
||||||
committer = InputGitAuthor(username, email)
|
committer = InputGitAuthor(username, email)
|
||||||
else:
|
else:
|
||||||
committer = InputGitAuthor('readme-bot', '41898282+github-actions[bot]@users.noreply.github.com')
|
committer = InputGitAuthor(
|
||||||
|
commit_username or 'readme-bot',
|
||||||
|
commit_email or '41898282+github-actions[bot]@users.noreply.github.com'
|
||||||
|
)
|
||||||
if new_readme != rdmd:
|
if new_readme != rdmd:
|
||||||
try:
|
try:
|
||||||
repo.update_file(path=contents.path, message=commit_message,
|
repo.update_file(path=contents.path, message=commit_message,
|
||||||
|
|||||||
Reference in New Issue
Block a user