added more detailed readme (#21)

* added more detailed readme

* Update README.md

Co-authored-by: Athul Cyriac Ajay <athul8720@gmail.com>

Co-authored-by: Athul Cyriac Ajay <athul8720@gmail.com>
This commit is contained in:
Stanley 2020-07-22 22:46:03 -06:00 committed by GitHub
parent 580f6d4639
commit 67a3568c75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,28 +48,43 @@ WakaTime gives you an idea of the time you really spent on coding. This helps yo
> You wouldn't need an GitHub Access Token since GitHub Actions already makes one for you.
Here is a sample workflow file for you to get started:
Please follow the steps below:
```yml
name: Waka Readme
1. Go to your `<username>/<username>/actions`, hit `New workflow`, `set up a workflow yourself`, delete all the default content github made for you.
2. Copy the following code and paste it to your new workflow you created at step 1:
```yml
name: Waka Readme
on:
schedule:
# Runs at 12am UTC
- cron: '0 0 * * *'
on:
workflow_dispatch
schedule:
# Runs at 12am UTC
- cron: '0 0 * * *'
jobs:
update-readme:
name: Update this repo's README
runs-on: ubuntu-latest
steps:
- uses: athul/waka-readme@master
with:
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
```
jobs:
update-readme:
name: Update this repo's README
runs-on: ubuntu-latest
steps:
- uses: athul/waka-readme@master
with:
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
```
3. Go to your repo secrets by hitting `Settings => Secrets` tab in your profile repo. You can also enter the url https://github.com/USERNAME/USERNAME/settings/secrets . Please replace the `USERNAME` with your own username.
4. Create a new `Secret`. `Name`: `WAKATIME_API_KEY`, `Value`: Paste the Wakatime API key here. If you don't know what is the key, please go to [Account Settings in WakaTime](https://wakatime.com/settings/account) to find your API Key there.
5. Add a comment to your `README.md` like this:
```md
<!--START_SECTION:waka-->
<!--END_SECTION:waka-->
```
6. Go to Workflows menu (mentioned in step 1), click `Waka Readme`, click `Run workflow`.
7. Go to your profile page. you will be able to see it.
### Other Repository (not Profile)
*If you're executing the workflow on another repo other than `<username>/<username>`*
You'll need to get a [GitHub Access Token](https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) with a `repo` scope and save it in the Repo Secrets `GH_TOKEN = <Your GitHub Access Token>`