This repository is for the meetup: https://www.meetup.com/ja-JP/CodeChrysalis/events/250738791/
With this repository, you can learn:
- How to add comments to GitHub issues using GitHub API v3.
- How to run commands after a git push/PR using CircleCI
You can fork the repo from the top right Fork button. Then clone and set up it with this command:
git clone https://github.com/{your_username}/circleci-meetup
cd circleci-meetup
yarn install
- You can send comments to GitHub Issues with command
node .cicleci/comment_from_local.js
- But before that you need to change some variables in
.cicleci/comment_from_local.js
in your forked repository.AUTH
: Add your Personal access tokens intoAUTH
to add permission to comment. You can get it from https://github.com/settings/tokens. And make sure you check public_repo (Access public repositories) option.USERNAME
: Change it into your username.ISSUE_NUMBER
: Add issue number you want to add comments to. At first, your forked repo has no issues, so you need to make an issue from repo on the GitHub web page.
- Go to CircleCI web page. https://circleci.com
- Sign Up with GitHub (if you don't have account).
- From ADD PROJECTS, add circleci-meetup repository.
- (You can get default config.yml(Linux/node). Compare with
.circleci/config.yml
in this repo.) - Start building! And it should fail. Go to next to fix it.
src/index.js
: This is a simple module for Fizz Buzz https://en.wikipedia.org/wiki/Fizz_buzztext/test.js
: Test code for src/index.js. You can run this withyarn test
. Let's try it.- Fix
src/index.js
. - Make feature branch.
git checkout -b fizzbuzz-1
- Make commit and pull request
git add src/index.js
git commit -m "Fix Fizz Buzz"
git push origin fizzbuzz-1
You can see results, variables and cashing from circleCI builds page. https://circleci.com/dashboard.
And see comment_from_circleci.js
and config.yml
.
.circleci/comment_from_circleci.js
is similar to .circleci/comment_from_local.js
Check these to learn about config.yml
-
How to write config.yml https://circleci.com/docs/2.0/configuration-reference/#run
-
Docker container https://hub.docker.com/r/circleci/node/tags/
Thank you to Code Chrysalis, without you this meetup and repository wouldn't exist.