Giter VIP home page Giter VIP logo

gist-todo-list-action's Introduction

Todo List using GitHub Gist

Features

Before

Create a Todo List in a GitHub Gist (following the task list syntax) and create a list, and check the tasks you have done off during the day.

before todo

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
after todo done

Usage

  • First create two gists from https://gist.github.com, 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: https://github.com/settings/tokens/new.

  • 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 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/<your_username>/<repository_name>/settings/secrets. It will look something like this:

    secrets.jpg

    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 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.

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 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):

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/[email protected]
      env:
        GH_TOKEN: ${{ secrets.GH_TOKEN }}
        TODO_GIST: ${{ secrets.TODO_GIST }}
        DONE_GIST: ${{ secrets.DONE_GIST }}
        TIME_ZONE: "Asia/Kolkata" # IST

License

MIT

gist-todo-list-action's People

Contributors

ayan-b avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.