ã¿ã¤ãã«ã¯è¥è ã¨ã³ããªã¡ã¼ã«ã¼ã§çæãã¾ããã
ã³ãããã¹ãã¼ã¿ã¹ã¨ããã®ã¯ GitHub ã® API ã§ç¹å®ã®ã³ãããã« success/failure/pending ã®ã¹ãã¼ã¿ã¹ãä¸ãããã¨ãã§ãããã¤ã§ãä¾ãã° CI ã§ãã¹ãããçµæããã«ãªã¯ã¨ã¹ãã®ã¦ã§ãç»é¢ã§ç¢ºèªã§ããã誰ã§ãè¦ããã¨ããã¨æãã
æ¥åã§ã使ã£ã¦ããã©ãgit push ãããã¨ã«ãã¡ãã¡çµæã確èªããã®ãé¢åã ã£ãã®ã§ãã¿ã¼ããã«ãã確èªã§ãããããªã®ãä½ã£ãã
ããã³ããã«è¡¨ç¤ºããã¨ããããæãã§âã確èªã§ãã¦ä¾¿å©ï¼æå¾ã«è¨å®ä¾ãããã¾ãï¼ã
ã¤ã³ã¹ãã¼ã«ã»ä½¿ãæ¹
% go get github.com/motemen/github-commit-status-mark
æ®éã«èµ·åããã¨ç¾å¨ã®ãªãã¸ããªã®ææ°ã®ã³ãããï¼HEADï¼ã®ã¹ãã¼ã¿ã¹ã GitHub ããåå¾ãã¦ãã¦ãè²ä»ãã®æåã§è¡¨ç¤ºããã
ãã®ã¹ã¯ãªã¼ã³ã·ã§ããã«ã¯ãªããã©ãã¹ãã¼ã¿ã¹ãåå¨ããªãã¨ã㯠"?" ã¨è¡¨ç¤ºããã
è¨å®
ã¾ãã¯ãã¤ãéã https://github.com/settings/tokens/new ãããã¼ã¯ã³ãä½æãã¦ãã ããããã¶ã "repo:status" 権éã ãã§åãã¨æãããããªãã¯ãªãã¸ããªã ããªãè¨å®ããªãã¦ããããã©ããã¶ãããã« API Limit ã«éããã¨æãã
ç°å¢å¤æ°
GITHUB_COMMIT_STATUS_TOKEN
ã«ãã¼ã¯ã³ãå
¥ããããã®å ´å GitHub:Enterprise ã«å¯¾å¿ãã¦ãªãã®ã§å¾®å¦ã
.netrc
(new!)
ãã® .netrc ã«æä½ã®ãã¼ã«ã¨ãã¦ã¯åãã¦ææ¦ããã¡ã¤ã³ã«å¯¾ããã¢ã«ã¦ã³ãè¨å®ã¨ãªãã®ã§ãä»ã® GitHub ç³»ãã¼ã«ã .netrc ã«å¯¾å¿ãã¦ããã°ãã¼ã¯ã³ãå ±æãããã¨ã«ãªãã楽ã ãã©ã権éã®ç®¡çã¨ããç¹ã§ã¯ä¸å®ãªä¸é¢ãã
domain api.github.com user motemen password YOUR_TOKEN domain ghe.example.com user motemen password YOUR_TOKEN
.gitconfig
ããªãã¿ gitconfigãgithub-commit-status.token
ããã㯠github-commit-status.https://ghe.example.com/.token
ã«ãã¼ã¯ã³ãè¨å®ããã
[github-commit-status] token = YOUR_TOKEN [github-commit-status "https://ghe.example.com/"] token = YOUR_TOKEN
ãã£ãã·ã¥
å¤é¨ã® API ãå©ãã®ã§ã.github-commit-status/ 以ä¸ã«ãã£ãã·ã¥ãä½ã£ã¦ãåã®çµæãä¸å®æéãã£ãã·ã¥ããããã«ãã¦ããç¹ã«ä¸åº¦ success ã failure ã«ãªã£ãçµæã¯æ°¸é ã«ãã£ãã·ã¥ãããã-update
ã -cached
ãªãã·ã§ã³ã§ãã£ãã·ã¥ãå¼·å¶çã«æ´æ°ãããã絶対㫠API ãªã¯ã¨ã¹ããããªãããã«ãããã§ããã
ããã³ããã«è¡¨ç¤ºãã
èªç¶ã«ã¹ãã¼ã¿ã¹ã確èªã§ããããã«ãã¨ã³ã¸ãã¢ã®ããã³ãã£ã¢ã§ããã·ã§ã«ã®ããã³ããã«ããã表示ãããããã©ãããã³ããæç»ã®ãã³ã« API ã¢ã¯ã»ã¹ãçºçããã¨ä½¿ãã¥ããã®ã§ãããã¯ã°ã©ã¦ã³ãã§éä¿¡ãè¡ãã¤ã¤ãããã³ããã«è¡¨ç¤ºããå 容ã¯ãã£ãã·ã¥ããããã®ã使ããã¨ãã風ã«ãã¦ã¿ã¦ãããããªæãã
https://github.com/motemen/dotfiles/blob/3373c12/.zshrc#L174-L177
以ä¸ã§ã
motemen/github-commit-status-mark · GitHub
追è¨
@motemen ã¢ã¤ã³ã³ã¯åºãªãã§ããã©ãhubã«ci-statusã£ã¦ã³ãã³ãããã£ã¦ãããã§ããããæ°ããã¾ã
— ããã«ãã (@giginet) July 1, 2014
@giginet ã¦ãªã¢ã¢ã¢ã¢ã¼ï¼ï¼ï¼
— ã¸ã£ãã¯ãã¤ãã®ãããªç· (@motemen) July 1, 2014