Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yinkakun/wakatime-github-commit
A serverless function that auto commits your daily total time tracked on Wakatime to Github. Using Netlify Scheduled Functions, Github GraphQL API, and Wakatime API.
https://github.com/yinkakun/wakatime-github-commit
github-api netlify-functions serverless wakatime
Last synced: 2 months ago
JSON representation
A serverless function that auto commits your daily total time tracked on Wakatime to Github. Using Netlify Scheduled Functions, Github GraphQL API, and Wakatime API.
- Host: GitHub
- URL: https://github.com/yinkakun/wakatime-github-commit
- Owner: yinkakun
- License: mit
- Created: 2022-08-06T10:54:39.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-09T01:14:01.000Z (over 2 years ago)
- Last Synced: 2024-10-31T11:51:43.688Z (2 months ago)
- Topics: github-api, netlify-functions, serverless, wakatime
- Language: TypeScript
- Homepage:
- Size: 31.3 KB
- Stars: 23
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wakatime Stats Github Commit
Auto commit your daily total time tracked on Wakatime to Github. Using Netlify Scheduled Functions, Github GraphQL API, and Wakatime API.
## Setup
1. Fork this repository.
2. You'll need a [WakaTime API Key](https://wakatime.com/settings/api-key), which you can get from your WakaTime Account Settings. Store the token somewhere secure, we'll need it shortly.
3. You'll need a GitHub Personal Access Token with `repo` and `admin:repo_hook` scope which can be generated [here](https://github.com/settings/tokens). Store the token somewhere secure, we'll need it shortly.
4. Import Repo to Netlify - Go to the [Netlify Dashboard page](https://app.netlify.com), Click the `Add New Site` > `Import An Existing Project` > `GitHub` button. Authorize the app to access your GitHub account then choose the cloned repo. Add required environment variables, Click the `Show Advanced` > `New Variable` button. Add these variables:
```env
WAKATIME_API_KEY=
GITHUB_ACCESS_TOKEN=
REPO_NAME=
GITHUB_USERNAME=
```Then click the `Deploy Site` button. Go to the `Functions` tab of the dashboard and click the `Enable Scheduled Functions` button. After a few seconds, your function should be successfully deployed.
## Local Development
```bash
# Install the Netlify CLI
npm install -g netlify-cli.# Login to netlify
netlify login# Clone the repository and navigate to project directory
git clone# Start the functions server
netlify functions:serve# Function will be available at
http://localhost:9999/.netlify/functions/log-tracked-time# For typescript project, before committing the files, run:
tsc --noEmit
```TODO
- Filter duplicate dates