Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rehborn/github-activity-svg
Generate Monthly Calendar SVGs for GitHub and Wakatime activities
https://github.com/rehborn/github-activity-svg
github-action github-contributions github-profile wakatime-stats
Last synced: about 2 hours ago
JSON representation
Generate Monthly Calendar SVGs for GitHub and Wakatime activities
- Host: GitHub
- URL: https://github.com/rehborn/github-activity-svg
- Owner: rehborn
- Created: 2023-08-30T22:35:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-02T11:31:26.000Z (over 1 year ago)
- Last Synced: 2025-01-10T10:24:10.470Z (6 days ago)
- Topics: github-action, github-contributions, github-profile, wakatime-stats
- Language: Python
- Homepage: https://github.com/marketplace/actions/github-activity-svg
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Activity SVG
Generate Monthly Calendar SVGs for GitHub and Wakatime activies
| Github | Wakatime |
|----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
|![GitHub](docs/github.svg)|![Wakatime](docs/wakatime.svg)|- enable GitHub Pages for the repository
- optional: add `WAKATIME_JSON_URL` to repository secrets (create a JSON embed at [wakatime](https://wakatime.com/share/embed) `JSON`, `Coding Activity`)### Simple Action Usage
```yaml
- name: "Run Github Activity Action"
uses: rehborn/[email protected]
with:
months: 12
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTOR: ${{ github.actor }}
WAKATIME_JSON_URL: ${{ secrets.WAKATIME_JSON_URL }}
```the action will store all SVGs in `dist/`, output filenames suffix the index,
starting with 0 as the current month, going back in time as the index increases:- `gitlab-0.svg` (this month)
- `gitlab-1.svg` (last month)
- `wakatime-0.svg`
- `wakatime-1.svg`### Complete Example Creating Artifact and Pushing to GitHub Pages
```yaml
name: Run Github Activity Actionon:
workflow_dispatch:
inputs:
months:
type: choice
description: 'number of months to generate'
options:
- "1"
- "2"
- "3"
- "6"
- "12"
- "24"schedule:
- cron: '0 0,12,18 * * *'permissions:
contents: read
pages: write
id-token: writejobs:
generate-and-publish-svg:
name: Generate Activity SVGs and Publish to Github Pages
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v3- name: "Run Github Activity Action"
uses: rehborn/[email protected]
with:
months: ${{ inputs.months || '3' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTOR: ${{ github.actor }}
WAKATIME_JSON_URL: ${{ secrets.WAKATIME_JSON_URL }}- name: Upload Web artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./dist/- name: Deploying Web artifact
uses: actions/deploy-pages@v2
```## Dependencies
- [DrawSVG](https://github.com/cduck/drawsvg)
- [requests](https://github.com/psf/requests)
- [python-dotenv](https://github.com/theskumar/python-dotenv)
- [python-dateutil](https://github.com/dateutil/dateutil)