Actions Init

This commit is contained in:
athul 2020-07-10 08:20:35 +05:30
parent 74594fa648
commit 4a9a347d32
3 changed files with 35 additions and 3 deletions

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM python:latest
# Install dependencies.
ADD requirements.txt /requirements.txt
RUN pip install -r requirements.txt
CMD python main.py

25
action.yml Normal file
View File

@ -0,0 +1,25 @@
name: 'Waka - Readme'
author: Athil Cyriac Ajay
description: 'Add a Wakatime Coding Activity graph in your Readme'
inputs:
GH_TOKEN:
description: 'GitHub access token with Repo scope'
default: ${{ github.token }}
WAKATIME_API_KEY:
description: 'Your Wakatime API Key'
required: true
USERNAME:
description: 'Your GitHub username'
default: ${{ github.repository_owner }}
runs:
using: 'docker'
image: 'Dockerfile'
branding:
icon: 'info'
color: 'blue'

View File

@ -8,9 +8,9 @@ START_COMMENT = '<!--START_SECTION:waka-->'
END_COMMENT = '<!--END_SECTION:waka-->'
listReg = f'{START_COMMENT}[\\s\\S]+{END_COMMENT}'
user = os.getenv("USERNAME")
waka_key = os.getenv("WAKATIME_API_KEY")
ghtoken = os.getenv("GH_TOKEN")
user = os.getenv("INPUT_USERNAME")
waka_key = os.getenv("INPUT_WAKATIME_API_KEY")
ghtoken = os.getenv("INPUT_GH_TOKEN")
def makeGraph(percent: float):