Skip to content

Commit

Permalink
Minor improvements and fixes (#40)
Browse files Browse the repository at this point in the history
- upgrade docker image to latest version
- Minify the json file
- Fix the entrypoint
- Reformat everything

Signed-off-by: Avinal Kumar <[email protected]>
  • Loading branch information
avinal committed Feb 26, 2022
1 parent d884031 commit 62aa64a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1,093 deletions.
42 changes: 27 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
<p align=center><img src="/waka.png"></p>
<p align=center><a href="https://github.com/avinal/Profile-Readme-WakaTime/blob/master/LICENSE"><img src="https://img.shields.io/github/license/avinal/Profile-Readme-WakaTime" alt="License"></a> <a href="https://github.com/avinal/Profile-Readme-WakaTime/releases"><img src="https://img.shields.io/github/v/release/avinal/Profile-Readme-WakaTime" alt="Releases"></a> <a href="https://github.com/avinal/lark"><img src="https://img.shields.io/badge/uses-avinal%2Flark-blueviolet"></a> <img src="https://github.com/avinal/avinal/workflows/Build%20Graph/badge.svg" alt="Build"> <img src="https://wakatime.com/badge/github/avinal/Profile-Readme-WakaTime.svg" alt="Time Tracked"> <a href="https://github.com/avinal/Profile-Readme-WakaTime/discussions"><img src="https://img.shields.io/badge/QnA-Discussions-blueviolet"></a></p>

If you use WakaTime to track your coding activity. You can add that to your README as a bar graph or embed in your blog/portfolio. Just add this action to any of your repository and there you have it. See mine below.
If you use WakaTime to track your coding activity. You can add that to your README as a bar graph or embed in your blog/portfolio. Just add this action to any of your repository and there you have it. See mine below.

## My WakaTime Coding Activity

<img src="https://github.com/avinal/avinal/blob/main/images/stat.svg" alt="Avinal WakaTime Activity"/>

## How to add one to your README.md
1. First get your WakaTime API Key. You can get it from your [WakaTime](https://wakatime.com) account settings.

1. First get your WakaTime API Key. You can get it from your [WakaTime](https://wakatime.com) account settings.
2. Save WakaTime API Key to Repository Secret. Find that by clicking the Settings tab. Keep the name of secret as **WAKATIME_API_KEY**.
3. Add following line in your README.md of your repo.
```html
<img src="https://github.com/<username>/<repository-name>/blob/<branch-name>/images/stat.svg" alt="Alternative Text"/>
Example: <img src="https://github.com/avinal/avinal/blob/main/images/stat.svg" alt="Avinal WakaTime Activity"/>
```
You can use this method to embed in web pages too. *Do not use markdown method of inserting images. It does not work some times.*


```html
<img
src="https://github.com/<username>/<repository-name>/blob/<branch-name>/images/stat.svg"
alt="Alternative Text"
/>
Example:
<img
src="https://github.com/avinal/avinal/blob/main/images/stat.svg"
alt="Avinal WakaTime Activity"
/>
```

You can use this method to embed in web pages too. _Do not use markdown method of inserting images. It does not work some times._

4. Click **Action** tab and **choose set up a workflow yourself**.
5. Copy the following code into the opened file, you can search for **WakaTime Stat** in marketplace tab for assistance.

```yml
name: WakaTime status update
name: WakaTime status update

on:
schedule:
# Runs at 12 am '0 0 * * *' UTC
- cron: '1 0 * * *'
- cron: "1 0 * * *"

jobs:
update-readme:
Expand All @@ -44,14 +56,14 @@ jobs:
BRANCH: "master"
# Manual Commit messages - write your own messages here
COMMIT_MSG: "Automated Coding Activity Update :alien:"

```
6. Please wait till 12 AM UTC to run this workflow automatically. Or you can force run it by going to Action tab. Or you can add following lines under `on:` to run with every push. Search for 12 AM UTC to find equivalent time in your time zone.
6. Please wait till 12 AM UTC to run this workflow automatically. Or you can force run it by going to Action tab. Or you can add following lines under `on:` to run with every push. Search for 12 AM UTC to find equivalent time in your time zone.

```yml
on:
push:
branches: [ master ]
branches: [master]
schedule:
- cron: '1 0 * * *'
- cron: "1 0 * * *"
```
20 changes: 10 additions & 10 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
# Distributed under the terms of MIT License
# The full license is in the file LICENSE, distributed with this software.

name: 'WakaTime Stat Update Action'
name: "WakaTime Stat Update Action"
author: Avinal
description: 'Generate a WakaTime activity bar graph to be used in the README.md or embedded in web-page'
description: "Generate a WakaTime activity bar graph to be used in the README.md or embedded in web-page"

inputs:
WAKATIME_API_KEY:
description: 'Your WakaTime API Key'
description: "Your WakaTime API Key"
required: true

GITHUB_TOKEN:
description: 'GitHub access token'
description: "GitHub access token"
required: true
default: ${{ github.token }}

BRANCH:
description: 'Which branch is used for saving images'
description: "Which branch is used for saving images"
required: false
default: "master"

COMMIT_MSG:
description: 'Manual commit messages'
description: "Manual commit messages"
required: false
default: "Automated Coding Activity Update :alien:"

runs:
using: 'docker'
image: 'Dockerfile'
using: "docker"
image: "Dockerfile"

branding:
icon: 'sun'
color: 'yellow'
icon: "sun"
color: "yellow"
Loading

0 comments on commit 62aa64a

Please sign in to comment.