ç¹å®ã®ã¦ã¼ã¶ã¼ã®ã¤ãã³ãã«ããGitHub Actionsã®Actionãä¿çç¶æ ã«ãã¦ãããå¾ã§æåå®è¡ã§ããããã«ãã
dependabotã ã¨ãrenovateã ã¨ãã使ã£ã¦ã©ã¤ãã©ãªã®ãã¼ã¸ã§ã³ã¢ããã®pull requestãèªåçã«éã£ã¦ããããã¨ãããããªæ©æ§ãå©ç¨ããã¦ããæ¹ãå¤ãã¨æãã¾ãã
常ã«ãããã®pull requestã«ç®ãå
ããã¦ããã¦å¸¸ã«åãè¾¼ã¿ç¶ããã¨ããã®ãçæ³çãªå½¢ã»ããããã¹ãã ã¨ã¯æãã®ã§ããããµã¨æ°ãæãã¨ãã¼ã¸ã§ã³ã¢ããã®pull requestãæºã¾ã£ã¦ãããpull requestèªèº«ãæ¹è¨ã«æ¹è¨ãéãã¦ãã......ã¿ãããªãã¨ãèµ·ããã¡ã§ã¯ãªãã§ããããã
ãããã£ãæã誰ãçµæãè¦ãããªãCI (i.e. GitHub Actions) ã ããåãç¶ãã¦ããã®ãè¦ã¦ããã®ãã§ãã¯ã¯ãã©ã¤ãã©ãªã¢ããã°ã¬ã¼ãæ¥ããããæã«æåã§åãã°ã³ã³ãã¥ã¼ãã£ã³ã°ãªã½ã¼ã¹ã®åæ¸ã«ãªãã®ã§ã¯ï¼ãã¨æããããã試ããã¨ãã次第ã§ãã
ãã®è¨äºã§ã¯ä¾ã¨ãã¦ãrenovateããã®pull requestã«å¯¾ãã¦èªåã§Actionãåã (ã¤ã¾ãä¸è¬ç㪠"CI" ) ã®ã§ã¯ãªãã¬ãã¥ã¢ã¼ã®æ¿èªãéããéã«åãããã«ãã¦ã¿ã¾ãã
Environmentãä½ã
Repositoryã«GitHubのEnvironmentãä½ãã¾ããä¾ãã°ã"renovate" ã¨ããååã®Environmentãä½ã£ã¦ã¿ããã¨ã¨ãã¾ãã
"Required reviewers" ã«ãã§ãã¯ãå
¥ãã¦ãrenovateããã®pull requestã«å¯¾ããActionã®å®è¡ãæ¿èªããã¦ã¼ã¶ã¼ãããã¯ãã¼ã ãæå®ãã¾ãã
ãã®ç¨éã®å ´å㯠"Deployment branches" 㯠"All Branches" ã§é©å½ãã¨æãã¾ãããé½åº¦ç°å¢ã«åãããã¨è¯ãã§ãããã
Actionå®ç¾©ãæ¸ã
ããã¯æ®éã«GitHub Actionsã®å®ç¾©ãæ¸ãã¾ãããã
éè¦ãªç¹ã¯ãæ®æ®µ (ã¤ã¾ãrenovate以å¤ã) å®è¡ããActionã¨renovateãå®è¡ããActionãããããç¨æããã¨ãããã¨ã§ãã
æ®æ®µå®è¡ããActionã®å®ç¾©ã«ã¤ãã¦ã¯
... jobs: your-action: if: ${{ github.actor != 'renovate[bot]' }} ...
ã¨æ¸ãã¦ãããrenovateãå®è¡ããActionã®å®ç¾©ã«ã¯
jobs: your-action: if: ${{ github.actor == 'renovate[bot]' }} environment: renovate
ã¨æ¸ãã¦ãããã¨ã§ãrenovate以å¤ã®æã¯æ®éã«èªåå®è¡ãããrenovateã®æ㯠environment: renovate
ãæå¹ã«ãªãæ¿èªãéããªãã¨Actionãå®è¡ãããªããã¨ã¨ãªãã¾ãã
ãã®yamlä¸ã®ifã«ã©ããã£ãæ¡ä»¶ãæ¸ãããã«ã¤ãã¦ã¯ä»¥ä¸ã®ããã¥ã¡ã³ããåç §ããã¨è¯ãã§ãããã
ä»åã¯actor (ã¤ãã³ãã®ä¸»ä½) ã®ååã«ãã£ã¦å¤æããã¨ããç´ æ´ãªæ¹æ³ãæ¡ãã¾ãããããã®ä»ã®contextã使ãã¨è²ã ãã¤ãã¯ãªãã¨ãã§ãããã§ããä¾ãã°renovateã«éãããbotã®æãã¯ãããããµãã«ããã¨ãã
ãã¨ãæå
ã®yamlã§ã¯renovateãå®è¡ããActionã®ã¤ãã³ãã« on push
ã§æå®ãã¦ããã®ã§ããããã㯠on pull_request
ã§ååãªã®ãããããªãã
ãããªæãã«ãªã
ãã®å ´å "e2e-test.yml" ã¨ããã®ãæ®æ®µèµ°ãActionã®yamlã "e2e-test-for-renovate.yml" ãrenovateã®æã«èµ°ãããActionã®yamlã¨ãªã£ã¦ãã¾ãã
ããã¯renovateã«ãã£ã¦ä½ãããpull requestãªã®ã§ããããæ®æ®µèµ°ãActionããã¹ãããããã¦ãããrenovateã®æã«èµ°ãããActionããpendingç¶æ
ã«ãªã£ã¦ãããã¨ããããã¨æãã¾ãã
ãã®æã "This branch is waiting to be deployed" ããã¡ãã¥ã¼ãããããé¸ãã§ããã¨
ãã®ãããªç¶æ³ã«ãªãã®ã§ãReview Deploymentsããæ¿èªãããã¨ã§Actionãããã¥ã¢ã«å®è¡ãããã¨ãã寸æ³ã§ãããã¨ã¯å®è¡çµæãè¦ã¦ããã¼ã¸ãããã©ãããç²¾æ»ãã¾ãããï¼
課é¡
taskå®ç¾©ãè¤æ°ç¨æããã®ããµããªãã»ã¡ã³ãé¢åãããªãï¼
ããã¯æ¬å½ã«ããï¼ãä½ãè¯ãæ¹æ³ãããã¨è¯ãã®ã§ãã......
[追è¨]
åãªãã¸ããªå ã«Reusable workflowãå®ç¾©ãã¦å¯¾è±¡ã®Workflowããå¼ã³åºãã1ã¤ã®Workflowã«2ã¤ã®Jobãå®ç¾©ãã¦çæ¹ã¯Renovateç¨ããçæ¹ã¯éRenovateç¨ã¨ãããã¨ãã§è¤æ°ç¨æããã®é¢åãªåé¡è»½æ¸ã§ããï¼
— r7kamura (@r7kamura) September 14, 2022
ãã¨ãcomposite actionã使ãã°è¯ãã®ã§ã¯ãªãããã¨ããã¢ããã¤ã¹ãããã¾ãã: Creating a composite action - GitHub Docs
ç¥è¦ãããã¨ããããã¾ãã
[追è¨ããã¾ã§]
æ¿èªã§ããReviewersã6人ã¾ã§ããæå®ã§ããªãã®ã¯å°ãªãããä½ãã権å¨ä¸»ç¾©çã ï¼ï¼ï¼
å人ã ãã§ãªããã¼ã ãæå®ã§ããã®ã§ããã§ããç¨åº¦ã«ãã¼ã§ããã®ã§ã¯ãªãã§ããããã
ä¾åã¢ãããã¼ãã®pull requestã®Actionãèªåã§å®äºãã¦ãªãã¨ãæ´ã«ãã¼ã¸ããã¢ããã¼ã·ã§ã³ä¸ãããªãï¼
ãããã......ãªã®ã§ã¢ããã¼ã·ã§ã³é«ã常ã«ä¾åã¢ãããã¼ãã®pull requestãè¦ã¦ããã»ãã¼ã¸ãã¦ãããã¨ããç°å¢ã§ã¯ä¸è¦ã ã¨æãã¾ãã
ä¸æ¹ãããç¨åº¦ã¾ã¨ãã¦ä¾åã®ã¢ãããã¼ãããã¦ãããããªç°å¢ã ã¨é½åº¦é½åº¦Actionãåã£ã¦ããå¿ è¦ãç¡ããã¨ãããã¨ã§ãªã½ã¼ã¹ãç¯ç´ã§ããã®ã§ã¯ãªãããã¨ããã®ããã®ä»çµã¿ã®çãã§ãã
ã¨ã¯ããããã®æ¹æ³ãéç¨ãã¯ããã¦ããæ¥ãæµ ãã®ã§ä»å¾ä½ãè¯ãç¹ã»æªãç¹ãè¦ãã¦ããå¯è½æ§ãããã¾ããã©ããªããã¨ããã