Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation #12

Open
simenandre opened this issue Mar 24, 2021 · 1 comment
Open

Improve documentation #12

simenandre opened this issue Mar 24, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation good-first-issue kind/enhancement

Comments

@simenandre
Copy link
Owner

simenandre commented Mar 24, 2021

Users probably want to have a template repository or at least a guide that they can use.

If anyone wants to be the host of a template repository, let me know!

The steps required to set up todoist-action is:

  1. Aquire a Personal Todoist API token (Stored as TODOIST_TOKEN)
  2. Aquire a Personal Github Token. (Stored as GH_TOKEN)
    Make sure you give this token access to repo and gist (if you are using Github Gist as your backend)
  3. (If you want to use Github Gist as backend) Create a Gist with the following content: {"github": [], "todoist": []}. You'll be needing the Gist ID (e.g. 879cd623592fc27beddebf1b2f7b3e15), found at the end of the URL. (Stored as GIST_ID)
  4. Add all the required secrets (GH_TOKEN and TODOIST_TOKEN. Potentially GIST_ID)
  5. Add your Github Actions config (e.g. .github/workflows/schedule.yml) (see the example below)
  6. Profit!

Example workflow

name: Synchronize Todoist
on:
  schedule:
   - cron: "*/30 * * * *"
  workflow_dispatch:
    

jobs:
  sync_issues:
    name: Synchronize!
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - run: gh gist view ${{ secrets.GIST_ID }} -f sync.json > ./sync.json
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}

      - name: Sync issues
        id: sync
        uses: cobraz/todoist-action@v1
        with:
          github-token: ${{ secrets.GH_TOKEN }}
          todoist-token: ${{ secrets.TODOIST_TOKEN }}
          query: archived:false sort:updated-desc assignee:<insert your Github username> updated:>2020-06-01 -label:backlog
          sync-file-name: ./sync.json
      
      - name: Deploy
        if: steps.sync.outputs.has-changed == 'true'
        uses: exuanbo/actions-deploy-gist@v1
        with:
          token: ${{ secrets.GH_TOKEN }}
          gist_id: 77b36845948f1565197e4b914e56a919
          gist_file_name: sync.json
          file_path: ./sync.json

👆 This updates every 30 minutes.

Note: You probably want to test your query before applying this. You can test your query here:
https://github.com/issues

Example query

archived:false assignee:<insert your Github username>
@simenandre simenandre added good-first-issue kind/enhancement documentation Improvements or additions to documentation labels Mar 24, 2021
@ShravanSunder
Copy link

@cobraz thank you so much for the detailed documentation. It was extremely useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good-first-issue kind/enhancement
Projects
None yet
Development

No branches or pull requests

2 participants