From 4e3dc0a20a0faaf55aca31056c5c4805c2faa8ca Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Sun, 12 Jul 2020 16:25:58 +0000 Subject: [PATCH 1/4] 'Refactored by Sourcery' --- main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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__': From 79d91bc51239acf340fce09dd3b274eb4c4b6e99 Mon Sep 17 00:00:00 2001 From: Jovial Joe Jayarson Date: Sun, 12 Jul 2020 22:28:52 +0530 Subject: [PATCH 2/4] fix: Added WakaTime info; Some tweaks --- README.md | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4bcdf43..b1fa7d4 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. + +1. Head over to https://wakatime.com and create an account. +2. Get your WakaTime API Key from your [Account Settings in WakaTime](https://wakatime.com/settings/account). +3. Install the [WakaTime plugin](https://wakatime.com/plugins) in your favourite editor / IDE. +4. 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 @@ -71,5 +80,5 @@ jobs: 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 + USERNAME: # optional, it will automatically use the username that executing the workflow ``` From 7d189fc98dda9c182e8b878db794ee6d9ac7c229 Mon Sep 17 00:00:00 2001 From: Jovial Joe Jayarson Date: Sun, 12 Jul 2020 22:39:47 +0530 Subject: [PATCH 3/4] fix: changed numbers to bullets; --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b1fa7d4..45ece85 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,10 @@ WakaTime gives you an idea of the time you really spent on coding. This helps you boost your productivity and competitive edge. -1. Head over to https://wakatime.com and create an account. -2. Get your WakaTime API Key from your [Account Settings in WakaTime](https://wakatime.com/settings/account). -3. Install the [WakaTime plugin](https://wakatime.com/plugins) in your favourite editor / IDE. -4. Paste in your API key to start the analysis. +- 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 @@ -80,5 +80,5 @@ jobs: with: WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} GH_TOKEN: ${{ secrets.GH_TOKEN}} - USERNAME: # optional, it will automatically use the username that executing the workflow + USERNAME: # optional, it will automatically use the username that's executing the workflow ``` From 96d2a79378948748255f6ed14c41e484b1168b53 Mon Sep 17 00:00:00 2001 From: Jovial Joe Jayarson Date: Sun, 12 Jul 2020 22:52:45 +0530 Subject: [PATCH 4/4] fix: made requested changes. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 45ece85..fa9150e 100644 --- a/README.md +++ b/README.md @@ -79,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 automatically use the username that's 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. ```