diff --git a/README.md b/README.md index 4bcdf43..fa9150e 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,41 @@ # Dev Metrics in Readme -[Wakatime](https://wakatime.com) Weekly Metrics on your Profile Readme: +[WakaTime](https://wakatime.com) Weekly Metrics on your Profile Readme: ![Project Preview](https://user-images.githubusercontent.com/8397274/87243943-e6b45c00-c457-11ea-94c9-2aa0bf241be8.png) +## New to WakaTime + +WakaTime gives you an idea of the time you really spent on coding. This helps you boost your productivity and competitive edge. + +- Head over to https://wakatime.com and create an account. +- Get your WakaTime API Key from your [Account Settings in WakaTime](https://wakatime.com/settings/account). +- Install the [WakaTime plugin](https://wakatime.com/plugins) in your favourite editor / IDE. +- Paste in your API key to start the analysis. + ## Update your Readme -Add a comment to your README like the follows +Add a comment to your `README.md` like this: ```md ``` -The lines will be our entrypoints for our metrics. +These lines will be our entry-points for the dev metrics. ## Using it -- Get your Wakatime API Key from your [Account Settings in Wakatime](https://wakatime.com/settings/account) and save it as `WAKATIME_API_KEY = ` in your Repository Secrets +Save your WakaTime API Key as `WAKATIME_API_KEY = ` in your [Repository Secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets). -That's it. The Action runs everyday at 00.00 UTC +That's it! The Action runs everyday at 00.00 UTC ### Profile Repository -If you're executing the workflow on your Profile Repository (`/`) +*If you're executing the workflow on your Profile Repository (`/`)* -**You wouldn't need an GitHub Access Token since GitHub Actions already makes one for you.** +> You wouldn't need an GitHub Access Token since GitHub Actions already makes one for you. -Here is a sample workflow file for you to get started, +Here is a sample workflow file for you to get started: ```yml name: Waka Readme @@ -46,13 +55,13 @@ jobs: WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} ``` -### Different Repository than Profile Repository +### Other Repository (not Profile) -if you're executing the workflow on another repo other than `/` +*If you're executing the workflow on another repo other than `/`* -- You'll need to get a GitHub Access Token with a `repo` scope and save it in the Repo Secrets `GH_TOKEN = ` +You'll need to get a [GitHub Access Token](https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) with a `repo` scope and save it in the Repo Secrets `GH_TOKEN = ` -Here is Sample Worflow File for running it +Here is Sample Worflow File for running it: ```yml name: Waka Readme @@ -70,6 +79,6 @@ jobs: - uses: athul/waka-readme@master with: WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} - GH_TOKEN: ${{ secrets.GH_TOKEN}} - USERNAME: # optional, it will automaticially use the username that executing the workflow + GH_TOKEN: ${{ secrets.GH_TOKEN }} + USERNAME: # optional, it will automatically use the username of the owner of the repository who's executing the workflow. ``` diff --git a/main.py b/main.py index b698913..04c4588 100644 --- a/main.py +++ b/main.py @@ -36,14 +36,12 @@ def getStats(): def decodeReadme(data: str): decodedBytes = base64.b64decode(data) - decodedStr = str(decodedBytes, "utf-8") - return decodedStr + return str(decodedBytes, "utf-8") def generatenewReadme(stats: str, readme: str): statsinReadme = f"{START_COMMENT}\n{stats}\n{END_COMMENT}" - newReadme = re.sub(listReg, statsinReadme, readme) - return newReadme + return re.sub(listReg, statsinReadme, readme) if __name__ == '__main__':