Skip to content

stilliard/github-task-list-completed

Repository files navigation

GitHub - Task list completed PR check

Install from the Marketplace: https://github.com/marketplace/task-list-completed

Check a pull request body for task lists / checkboxes / tickboxes & make sure they are all completed. The check will not pass until all task lists have been checked.

Mark it as a required check to preventing merging the PR until all tasks in a PR have been ticked off.

You can use this to check manual tests or requirements have been ticked off before the pull request can be merged.

E.g. Say you add some tasks like so

- [x] Check the size looks good on the front end
- [ ] Check the image is centered

& they display like this to be ticked off as tests:

this will show the check as pending as only 1 of the tasks is completed s (same if none etc.):

Once all tasks are marked off it'll show as completed:

Also when viewing all Pull Requests, you'll see the green tick when all completed:

& an orange dot when still tasks todo:

& if you have other CI tests such as unit tests etc, our pending status will not get in the way of failing tests, they will still show as the red cross:

Find out more about GitHub task lists: https://help.github.com/en/articles/about-task-lists


Powered By DO

This project is supported by & hosted on Digital Ocean, thanks!

Docs

Install & add to the repos you want.

Want to require tasks to be complete before it can be merged?

Inside your GitHub repo > Settings > Branches > Branch protection rules > Add rule > select require checks & require this check to pass.

By default, we mark the check as in_progress until all tasks pass and then it marks it as successful.

Skippable tasks

Tasks that contain "POST-MERGE" or "N/A" in all caps are skipped. This is useful for tasks that are not applicable to the PR, or tasks that are only applicable after the PR is merged. This was inspired by another project here.

Optional tasks

Tasks that contain "OPTIONAL" in all caps are also skipped unless checked, they are also added to an "(+X optional)" text in the check. This is useful for tasks that are not required to be completed before the PR can be merged.

Contributing / Development

Code previous ran on Glitch, now it's hosted on Digital Ocean. Hosting is via multiple droplets, one configured as a load balancer & then additional worker nodes/droplets for the actual checks to run on.

For previous glitch deployments, on the glitch page, click tools > console and then run git pull origin master && refresh. Permission changes would need to be changed in the app on github.

Local development

Using node v18+ & npm 10+ (older versions may also work, your mileage may vary).

Local development can be done by cloning this repo:

git clone https://github.com/stilliard/github-task-list-completed.git
cd github-task-list-completed

Setup up an App inside GitHub: https://github.com/settings/apps/

Install & run:

npm install
npm run dev

Load up http://localhost:3000/probot and follow intructions to set up the app. On first run, it will create your .env with an initial WEBHOOK_PROXY_URL=xxxxx. After following the set up, make sure you have APP_ID, PRIVATE_KEY, WEBHOOK_SECRET all set. You can change the port it runs on with PORT=3001 for example and set a NODE_ENV=production for production logs, more details about logs here.

View full Probot docs here.

Testing:

npm test

For production:

npm install --omit=dev
npm start

Instead of npm start, typically in production you'll use a service file to run via systemd or similar. e.g.

[Service]
ExecStart=npm start
WorkingDirectory=/srv/github-task-list-completed
Restart=always

[Install]
WantedBy=multi-user.target

You can also help support the hosting and development of this project with coffee power:

Buy Me A Coffee

Security

All code is Open source, MIT license. Production checks currently log repo name & PR ID for debug purposes only and logs are removed after a max of 7 days. No logs are recorded about your repos themselves nor the pull request contents.

Hosted check is on DO's SFO3.

If you discover a security issue please email it to myself at [email protected] and I will get back to you asap. For all other issues or help you can create an issue on this project - Thank you.

Credits