Merge pull request #342 from guilyx/patch-1

Ok, I think, It's all good in that case
This commit is contained in:
Alexander Sergeev
2023-01-21 19:46:00 +04:00
committed by GitHub
4 changed files with 12 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
INPUT_WAKATIME_API_KEY=""
INPUT_PUSH_BRANCH_NAME="main"
INPUT_SECTION_NAME="waka"
INPUT_SHOW_TIMEZONE="True"
INPUT_SHOW_PROJECTS="False"
INPUT_SHOW_EDITORS="False"

View File

@@ -62,6 +62,8 @@ Add a comment to your `README.md` like this:
<!--END_SECTION:waka-->
```
`waka` can be replaced by any string specified in the `SECTION_NAME` flag as per (the available flags section)[#flags-available]
These lines will be our entry-points for the dev metrics.
## New to WakaTime
@@ -119,6 +121,8 @@ jobs:
`LOCALE` This Flag can be used to show stats in your language default is english uses Locale [Short Hand](https://saimana.com/list-of-country-locale-code/) to be passed in the flag variable example of the final result can be found [here](https://github.com/anmol098/anmol098/blob/master/Readme-fr.md)
`SECTION_NAME` flag can be set to any string, and will be the name of the section to replace in the readme
`COMMIT_BY_ME` flag can be set to `True` to commit the code using your name and email
`COMMIT_MESSAGE` flag can be set to message commit, default is "Updated with Dev Metrics"

View File

@@ -12,6 +12,11 @@ inputs:
description: 'Your Wakatime API Key'
required: true
SECTION_NAME:
description: 'Name used in readme to scope the updated section'
required: false
default: "waka"
PUSH_BRANCH_NAME:
required: false
description: "The branch to update the readme in"

View File

@@ -24,8 +24,8 @@ from dotenv import load_dotenv
load_dotenv()
START_COMMENT = '<!--START_SECTION:waka-->'
END_COMMENT = '<!--END_SECTION:waka-->'
START_COMMENT = f'<!--START_SECTION:{os.getenv("INPUT_SECTION_NAME")}-->'
END_COMMENT = f'<!--END_SECTION:{os.getenv("INPUT_SECTION_NAME")}-->'
listReg = f"{START_COMMENT}[\\s\\S]+{END_COMMENT}"
waka_key = os.getenv('INPUT_WAKATIME_API_KEY')