Awesome
<p align="center"> <img width="400" src="https://user-images.githubusercontent.com/8252317/83985147-9afb2800-a96a-11ea-9841-eec3a1f61d75.png"> <h3 align="center">waka-box-go</h3> <p align="center">๐ Update pinned gist / profile README to contain your weekly WakaTime stats. </p> <p align="center"> A Golang implementation, see the original version <a href="https://github.com/matchai/waka-box">waka-box</a> <p align="center"> <a href="https://github.com/YouEclipse/waka-box-go/workflows/Update%20gist%20with%20WakaTime%20stats/badge.svg?branch=master"><img src="https://github.com/YouEclipse/waka-box-go/workflows/Update%20gist%20with%20WakaTime%20stats/badge.svg?branch=master" alt="Update gist with WakaTime stats"></a> </p> </p>English | ็ฎไฝไธญๆ
๐โจ For more pinned-gist projects like this one, check out: https://github.com/matchai/awesome-pinned-gists
๐ป Setup
๐ Prep work
if only want's to update a markdown,like profile README,skip step 1 and step 2.
- Create a new public GitHub Gist with name
๐ Weekly development breakdown
(https://gist.github.com/) - Create a token with the
gist
scope and copy it. (https://github.com/settings/tokens/new) - Create a WakaTime account (https://wakatime.com/signup)
- In your WakaTime profile settings (https://wakatime.com/settings/profile) ensure
Display coding activity publicly
andDisplay languages, editors, operating systems publicly
are checked. - In your account settings, copy the existing WakaTime API Key (https://wakatime.com/settings/api-key)
- For updating a markdown file๏ผadd comments to the place where you want to update in the markdown file.
<!-- waka-box start --> <!-- waka-box end -->
๐ Project setup
-
Fork this repo
-
Edit the environment variable in
.github/workflows/schedule.yml
:For updating github profile README,you can follow waka-box.yml in YouEclipse to create a Action in your README repo.Remember it's unsafe to use token with
repo
scope for updating the repo, waka-box update the profile repo using git command in Github Action instead of using github API.DO NOT CHANGE THE WAKATIME_API_KEY or GH_TOKEN VALUES IN THIS FILE, USE THE REPO SECRETS SET BELOW. FAILURE TO DO THIS WILL MAKE YOUR WAKATIME API KEY PUBLIC AND CAN POTENTIALLY EXPOSE SENSITIVE INFORMATION.
-
UPDATE_OPTION: Default is
GIST
.For only update a markdown file ,set toMARKDOWN
,and ignore environment variables with prefix GIST_ below.Set toGIST_AND_MARKDOWN
updates both the gist and the markdown file. -
MARKDOWN_FILE: The filename for the markdown file.
-
GIST_ID: The ID portion from your gist url:
https://gist.github.com/YouEclipse/
9bc7025496e478f439b9cd43eba989a4
.the following are optional, thanks @AarynSmith for PR(#11)
-
GIST_BARSTYLE: Background of the progress bar. Default is "SOLIDLT" other options include "SOLIDMD", "SOLIDDK" for medium and dark backgrounds, "EMPTY" for blank background, and "UNDERSCORE" for a line along the bottom.
-
GIST_BARLENGTH: Length of the progress bar. Default is 21. Set to -1 to auto size the bar.
-
GIST_TIMESTYLE Abbreviate the time text. Default is "LONG" ( "# hrs # mins" ). "SHORT" updates the text to "#h#m".
-
-
Go to the repo Settings > Secrets
-
Add the following environment variables:
- GH_TOKEN: The GitHub token generated above.
- WAKATIME_API_KEY: The API key for your WakaTime account.
๐ต๏ธ How it works
- Get stats from WakaTime API
- Update Gist with Github API
- Use Github Actions for updating Gist
๐ License
This project is licensed under Apache-2.0