https://github.com/ayan-b/gist-todo-list-action
:white_check_mark: Todo List using GitHub Gist
https://github.com/ayan-b/gist-todo-list-action
Last synced: 9 months ago
JSON representation
:white_check_mark: Todo List using GitHub Gist
- Host: GitHub
- URL: https://github.com/ayan-b/gist-todo-list-action
- Owner: ayan-b
- License: mit
- Created: 2020-03-11T10:28:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T04:43:36.000Z (about 6 years ago)
- Last Synced: 2024-04-18T20:21:37.783Z (about 2 years ago)
- Language: Python
- Homepage:
- Size: 71.3 KB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Todo List using GitHub Gist
## Features
### Before
Create a Todo List in a GitHub Gist (following the
[task list syntax](https://help.github.com/en/github/managing-your-work-on-github/about-task-lists#creating-task-lists))
and create a list, and check the tasks you have done off during the day.

### After
After midnight your done tasks will be transferred to the done list. In this
way you will have a history of your list!
| Todo | Done |
|--------------------------------------|--------------------------|
|  |  |
## Usage
- First create two gists from , namely `todo` and `done`.
- Add file `todo.md` and `done.md` to them respectively. The file content should
be a single header `# Todo` and `# Done` respectively.
- Generate a new personal access token with gist scope from
here: .
- Fork this repository. Note that if you want to use GitHub Action from market place,
you don't need to fork this repository. See [this](#using-with-github-action) for more instruction.
- Add the gist IDs as `TODO_GIST`, `DONE_GIST` and the personal access token as
`GH_TOKEN` to your repository secrets: `https://github.com///settings/secrets`.
It will look something like this:

> Gist ID is the part of the URL after your username. For example the gist ID
of this gist `https://gist.github.com/ayan-b/1b44e52eifj09bc75c914f6fedf95304`
is `1b44e52eifj09bc75c914f6fedf95304`.
- Now you have your todo list using GitHub gist!
- **Optional**: Change the time of [cron job](.github/workflows/update-list.yml)
in the workflow file according to your time zone so that the todo and done
list update exactly at midnight (and not at UTC midnight)!
Here's one for IST time zone (UTC +5:30). Note the use of `TIME_ZONE` environment
variable and the change in cron job.
```yaml
name: Update Todo List IST
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "30 5 * * *" # 0 + time zone difference time
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics
- name: Update todo list
run: |
python3 construct_todo.py
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TODO_GIST: ${{ secrets.TODO_GIST }}
DONE_GIST: ${{ secrets.DONE_GIST }}
TIME_ZONE: "Asia/Kolkata" # IST
```
Note that you can use docker as well in the last step (`Update todo list`) as done
in the [`update-list.yml`](.github/workflows/update-list.yml) file. But it will
be slower. You can also omit the `Lint with flake8` step.
### Using with GitHub action
If you want to use GitHub action, your workflow yaml file will look something like
this (be sure to change the version to the latest one):
```yaml
name: Update Todo List IST
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "30 5 * * *" # 0 + time zone difference time
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Todo List using GitHub Gist
uses: ayan-b/gist-todo-list-action@0.1.0
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TODO_GIST: ${{ secrets.TODO_GIST }}
DONE_GIST: ${{ secrets.DONE_GIST }}
TIME_ZONE: "Asia/Kolkata" # IST
```
## License
[MIT](LICENSE)