Are you an early đ¤ or a night đŚ? Letâs check out in the Gist
date
Apr 21, 2020
slug
are-you-an-early-or-a-night-lets-check-out-in-gist
status
Published
tags
Side Project
summary
Last week, I build a simple GitHub Action, called productive-box. Itâs my first time creating a GitHub Action so I would like to share some insight about it.
type
Post
Last week, I build a simple GitHub Action, called productive-box. Itâs my first time creating a GitHub Action so I would like to share some insight about it.
Â
The kernel concept about this project is using commit histories to find your most productive hours and declare which type of people you are(simply an early đ¤ or a night đŚ), finally write into your Gist.
Commit history
When it comes to âcommitâ, we always think of GitHub. Thatâs right. Here I using GitHub API to access commit history. Itâs also my first time using it. In the beginning, I check out the v3 RESTful API, but I found something new â v4 GraphQL API, so I gave it a try.
Â
The greatest part of GitHub GraphQL API is it provides a real-time and interactive playground â GraphQL Explorer which makes a better experience with this new stuff.
Â
After I completed this project, I knew that GraphQL just means POST a query and gets something you REALLY need.
Gist
Like him, I also use @octokit/rest, the GitHub REST API client for JavaScript.
WorkFlows
Workflows are custom automated processes that you can set up in your repository to build, test, package, release, or deploy any project on GitHub.
Simply saying, it uses GitHubâs virtual machine to execute our script and we just only need to write YAML config into .github/workflows/xxx.yml.
My Action simply listens to two events: push and schedule. It means that when we push some commits to the master branch(by default) or periodically(just a Linux cron job), it will trigger my built script.
Going Forward
I also have some other ideas about this project. Welcome to follow up or star â ď¸my project if youâre interested in it.
Feedback welcome! Thanks for reading.