diff --git a/.env.example b/.env.example index a7be1ff..23d0d27 100644 --- a/.env.example +++ b/.env.example @@ -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" diff --git a/README.md b/README.md index d17499c..353aaaa 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ Add a comment to your `README.md` like this: ``` +`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" diff --git a/action.yml b/action.yml index 04a9cbe..3643eb2 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,11 @@ inputs: WAKATIME_API_KEY: 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 diff --git a/main.py b/main.py index 14d0c08..76ac75b 100644 --- a/main.py +++ b/main.py @@ -24,8 +24,8 @@ from dotenv import load_dotenv load_dotenv() -START_COMMENT = '' -END_COMMENT = '' +START_COMMENT = f'' +END_COMMENT = f'' listReg = f"{START_COMMENT}[\\s\\S]+{END_COMMENT}" waka_key = os.getenv('INPUT_WAKATIME_API_KEY')