Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

モノレポのプルリクエストに最近、導入したもの

 モノレポのプルリクエストに最近、導入したもの

YUMEMI.grow ( https://yumemi.connpass.com/event/318110/ ) の資料

Hiroyuki Kusu

June 03, 2024
Tweet

More Decks by Hiroyuki Kusu

Other Decks in Technology

Transcript

  1. - uses: yumemi-inc/path-filter@v2 with: patterns: | front/** !front/doc/** run: |

    cd front/ npm run test  2. ඞཁͳαϒγεςϜͷΈ࣮ߦ ྫɿϓϧϦΫͰ front/ ഑Լͷίʔυ͕มߋ͞Ε͍ͯΔ৔߹ͷΈςετΛ࣮ߦ ※ ϫʔΫϑϩʔؙ͝ͱ࣮ߦ͢Δ/͠ͳ͍ͷ੍ޚͰΑ͍৔߹͸ϫʔΫϑϩʔͷτϦΨʔ৚݅ͷ paths Ͱ΋Α͍Ͱ͢
  2. env: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ github.token }} steps:

    - uses: yumemi-inc/path-filter@v2 with: patterns: 'server/**' run: gh pr edit ${{ github.event.number }} --add-label 'server' run-if-not: gh pr edit ${{ github.event.number }} --remove-label 'server' - uses: yumemi-inc/path-filter@v2 with: patterns: 'front/**' run: gh pr edit ${{ github.event.number }} --add-label 'front' ɹ run-if-not: gh pr edit ${{ github.event.number }} --remove-label ‘front' …  3. ࣗಈͰϓϧϦΫʹϥϕϧΛ෇༩ ※ actions/labeler ͕αϙʔτ͍ͯ͠ͳ͍৚݅Ͱ΋ϥϕϧ෇͚Ͱ͖ΔΑ͏͜͏͍ͯ͠·͢
  3.  4. ϒϥϯν໊ͷνΣοΫ • ϞϊϨϙʹ͓͍ͯ͸ɺ௨ৗͷ git- fl ow ౳ͷϒϥϯνʹՃ͑ͯɺαϒγες Ϝ༻ͷϒϥϯνΛ࡞ͬͨΓ

    pre fi x Λ͚ͭͨΓ͕ͪ͠ʢݸਓతͳ؍ଌʣ • ྫɿ feature/server/hogeɺhot fi x/front/fuga • .. ͓ͷͣͱϒϥϯνͷӡ༻ϧʔϧ͸ෳࡶͱͳΔͷͰػցతʹνΣοΫ
  4. - name: Fail if head branch name is invalid if:

    |- !( github.head_ref == 'develop' || startsWith(github.head_ref, 'feature/server/') || startsWith(github.head_ref, 'feature/front/') || ... ) uses: yumemi-inc/comment-pull-request@v1 with: comment: | Head branch name is invalid. fail: true  4. ϒϥϯν໊ͷνΣοΫ ϓϧϦΫʹίϝϯτͭͭ͠ϫʔΫϑϩʔΛམͱ͢ ※ ࣮ࡍͷӡ༻Ͱ͸ head ϒϥϯνຖͷ base ϒϥϯν໊ͷνΣοΫʢ޲͖ઌ͕ਖ਼͍͔͠ʣ΋͍ͯ͠·͢
  5.  5. αϒɾϓϧϦΫΤετҰཡΛίϝϯτ ͋Δػೳ a ͷϓϧϦΫʹɺαϒγεςϜ bɺc ͷϓϧϦΫؚ͕·ΕΔέʔε ʢػೳ a

    ͷ࣮ݱʹ͸ɺෳ਺ͷαϒγεςϜΛލͬͨίʔυͷमਖ਼͕ඞཁͳ৔߹ʣ feature/a ← feature/sub_b ͷϓϧϦΫ feature/a ← feature/sub_c ͷϓϧϦΫ develop ← feature/a ͷϓϧϦΫ Ϛʔδ Ϛʔδ
  6.  5. αϒɾϓϧϦΫΤετҰཡΛίϝϯτ - name: List associated pull request numbers

    uses: yumemi-inc/associated-pull-requests@v1 id: associated-pr with: format: 'markdown' merge-commit-only: false - name: Comment if: steps.associated-pr.outputs.numbers != null uses: yumemi-inc/comment-pull-request@v1 with: comment: | ### pull requests merged into this pull request: ${{ steps.associated-pr.outputs.numbers }} previous-comment: 'hide' Ϛʔδͷӡ༻࣍ୈ͕ͩ false ͷํ͕औΓ͜΅͕͠ແ҆͘ṛ ʢͨͩίϛοτཤྺ͕௕͍৔߹͸͕͔͔࣌ؒΔʣ
  7.  6. Bitrise ͷϫʔΫϑϩʔΛ GitHub Actions Ͱ࣮ߦ - uses: yumemi-inc/path-filter@v2

    id: filter with: patterns: 'ios/**' - if: steps.filter.outputs.exists == 'true' uses: p-mazhnik/bitrise-run-build@v1 with: bitrise-app-slug: 'your-app-slug' bitrise-token: ${{ secrets.YOUR_TOKEN }} bitrise-workflow: 'your-workflow-name' listen: true skip-git-status-report: true - if: failure() ... ྫ͑͹αϒγεςϜ͏ͪ iOS ͸ Bitrise ͰϏϧυ͢Δɺͱ͍͏έʔε ݁ՌΛ଴ͬͯ࣍ͷ step Λ࣮ߦͰ͖Δʂ
  8.  6. Bitrise ͷϫʔΫϑϩʔΛ GitHub Actions Ͱ࣮ߦ • Bitrise ͷϫʔΫϑϩʔΛ

    GitHub Actions ͷ 1 step ͱͯ͠૊ΈࠐΊΔͷ Ͱͱͯ΋ศར