Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GitHub Actionsのカスタムアクションを公開する
Search
yorifuji
December 14, 2023
Programming
0
230
GitHub Actionsのカスタムアクションを公開する
yorifuji
December 14, 2023
Tweet
Share
More Decks by yorifuji
See All by yorifuji
GitHub Actionsのカスタムアクションを作成してMarketplaceで公開した話
yorifuji
0
130
Flutter開発とGitHub Actions
yorifuji
0
210
iOSアプリ開発でGitHub Actionsのself-hosted runnerを使う
yorifuji
1
1.4k
Other Decks in Programming
See All in Programming
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
920
ナレッジイネイブリングにAIを活用してみる ゆるSRE勉強会 #9
nealle
0
150
Formの複雑さに立ち向かう
bmthd
1
930
Rubyと自由とAIと
yotii23
6
1.7k
技術を改善し続ける
gumioji
0
120
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
40
16k
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
150
2025.2.14_Developers Summit 2025_登壇資料
0101unite
0
180
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.1k
Rails アプリ地図考 Flush Cut
makicamel
1
130
Better Code Design in PHP
afilina
0
160
5分で理解する SOLID 原則 #phpcon_nagoya
shogogg
1
300
Featured
See All Featured
Writing Fast Ruby
sferik
628
61k
Making Projects Easy
brettharned
116
6k
RailsConf 2023
tenderlove
29
1k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.3k
How to Think Like a Performance Engineer
csswizardry
22
1.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Building Your Own Lightsaber
phodgson
104
6.2k
Scaling GitHub
holman
459
140k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Transcript
GitHub ActionsͷΧελϜΞΫγϣϯΛެ։͢Δ 2023.12.14 YORIFUJI MITSUNORI
ࣗݾհ • YORIFUJI MITSUNORI • @yorifuji on X / GitHub
/ Zenn • ۚ༥ܥελʔτΞοϓͷiOSΤϯδχΞ
ࠓͷൃදͪ͜ΒͷهࣄΛϕʔεʹͨ͠༰ʹͳΓ·͢ https://zenn.dev/yorifuji/articles/feec2c0294c7f9
GitHub Actions https://github.co.jp/features/actions
GitHub ActionsͰFlutterͷ ੩తղੳΛ࣮ߦ͢ΔϫʔΫ ϑϩʔͷྫʢyamlϑΝΠ ϧʣ name: check on: pull_request permissions:
contents: read jobs: analysis: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - run: flutter pub get - run: flutter analyze
ࠓճϫʔΫϑϩʔͷ࡞Γ ํͰͳ͘ɺϫʔΫϑϩʔ Ͱར༻͢ΔΞΫγϣϯΛ࡞ ͢Δ name: check on: pull_request permissions: contents:
read jobs: analysis: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - run: flutter pub get - run: flutter analyze
ࢲ͕࡞ɾެ։ͨ͠ΞΫγϣϯͪ͜Β☝ https://github.com/marketplace/actions/ fl utter-analyze-commenter
CIʢ੩తղੳʣ͕ࣦഊͨ࣌͠ʹϩάͷ༰Λ֬ೝ͢Δͷ໘
Flutterͷιʔείʔυͷ੩తղੳͷ ݁ՌΛPull RequestʹϨϏϡʔίϝ ϯτͱͯ͠ॻ͖ࠐΉΞΫγϣϯΛ࡞ ͠·ͨ͠
͍ํϫʔΫϑϩʔʹ ΞΫγϣϯΛՃ͢Δͩ ͚ name: flutter-analyze-commenter example on: pull_request permissions: contents:
read pull-requests: write jobs: analysis: runs-on: ubuntu-latest steps: ... - run: flutter analyze --write=flutter_analyze.log - uses: yorifuji/flutter-analyze-commenter@v1 if: ${{ !cancelled() }} with: analyze_log: flutter_analyze.log
ݩʑผͷπʔϧΛར༻͍ͯͨ͠ • Problem MatchersͱDangerΛΈ߹Θͤͯಉ༷ͷ࡞ۀΛߦͳ͍ͬͯͨ • ҎԼͷ͕ෆຬ • 2ͭπʔϧͰίϝϯτͷϑΥʔϚοτͷڍಈʹҧ͍͕͋Δ • ϫʔΫϑϩʔͷଞʹϑΝΠϧͷஔͳͲͷηοτΞοϓ͕ඞཁ
• DangerߴػೳͰଟ༻్Ͱ͋Δ໘ɺRubyͷґଘϥΠϒϥϦͷΠϯε τʔϧ͕ඞཁɺΦʔόʔεϖοΫʹײ͍ͯͨ͡
࡞ͨ͠ΞΫγϣϯͷΓ͑ͰআͰ͖ͨϑΝΠϧɾϫʔΫϑϩʔͷهड़
ΞΫγϣϯΛ࡞ͬͯެ։͢Δํ๏
GitHub Marketplace • GitHubެࣜɾOSSͷGitHub AppsΞΫγϣϯ͕ެ։͞Ε͍ͯΔ • ୳ͤඞཁͳͷେମ͋Δ • Ϩϐϡςʔγϣϯʢ⭐ʣ͕গͳ͍ϚΠφʔͳActionΛར༻͢Δͱ͖ ηΩϡϦςΟϦεΫͳͲʹҙ
MarketplaceʹΞΫγϣϯΛొ͢Δखॱ • ͜Ε͚ͩ • GitHubʹpublic repositoryΛ࡞ • ΞΫγϣϯͷఆٛΛॻ͍ͨaction.ymlΛ࡞ • ΧελϜΞΫγϣϯͷॲཧΛ࣮
• GitHub্ͰReleaseΛ࡞ͯ͠ެ։ • ৄ͍͠खॱͪ͜Β • https://docs.github.com/ja/actions/creating-actions/publishing-actions-in-github- marketplace
action.yml ͷهड़ྫʢ࣮ࡍͷΞΫγϣϯ͔Βൈਮʣ name: "Flutter Analyze Commenter" description: "Auto comment on
PRs based on Flutter Analyze results" inputs: analyze_log: description: "Path to the Flutter analyze log" required: true runs: using: composite steps: - uses: actions/github-script@v7 env: ANALYZE_LOG: ${{ inputs.analyze_log }} VERBOSE: ${{ inputs.verbose }} with: script: | const analyzeLog = process.env.ANALYZE_LOG; ...
ΧελϜΞΫγϣϯͷ࣮ํ๏ • Docker ίϯςφʔ ΞΫγϣϯ • ίϯςφΛ࣮ͬͯߦڥΛύοέʔδԽ͢Δํࣜ • ඞཁͳπʔϧґଘؔΛίϯςφͰཧͰ͖ΔͷͰҰ؏ੑͱ৴པੑΛ୲อ͍͢͠ •
ݱঢ়Linuxʢubuntuʣ ͷϥϯφʔͰͷΈར༻Ͱ͖ΔʢmacOSWindowsར༻ෆՄʣ • JavaScript ΞΫγϣϯ • Node.jsΛͬͯJavaScriptͷίʔυΛ࣮ߦ͢ΔΞΫγϣϯ • TypeScriptͰͷ։ൃՄೳʢ࠷ऴతʹJavaScript͕ੜͰ͖ΔͳΒͳΜͰྑ͍ʣɺෳࡶͳ࣮Λ͢ΔͳΒ͓͢͢Ί • ෳ߹ΞΫγϣϯʢComosite Actionʣ • ීஈ͍ͬͯΔϫʔΫϑϩʔ͔ΒॲཧΛΓग़͢Πϝʔδ • γΣϧεΫϦϓτͰͷ࣮͕جຊ • uses: ͕ར༻ՄೳͳͷͰ௨ৗͷΞΫγϣϯར༻Ͱ͖Δ
actions/github-script // ྫɿhello world - uses: actions/github-script@v7 with: script: console.log('Hello,
JavaScript') // ྫɿGithubͷREST APIΛͬͯIssueΛऔಘ - uses: actions/github-script@v7 with: script: | github.rest.issues.get({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) • ෳ߹ΞΫγϣϯͰJavaScriptΛͬͨॲ ཧΛهड़Ͱ͖ΔΞΫγϣϯ
࡞ͨ͠ΧελϜΞΫγϣϯͷ࣮ৄࡉ • Flutterͷ੩తղੳͷग़ྗ༰ʢςΩετʣΛղੳͯ͠ϑΝΠϧ໊ɺߦ൪߸ɺ ϝοηʔδʢܯࠂʣͳͲΛऔಘ͢Δ • ϑΝΠϧ໊ɾߦ൪߸ɾϝοηʔδΛͱʹGitHubͷREST APIΛͬͯPRʹ ରͯ͠ॻ͖ࠐΉ • PRʹରͯ͠मਖ਼ʢՃʣίϛοτ͕ൃੜͨ͠Βݹ͘ͳͬͨʢOutdatedͳʣ
ίϝϯτΛߋ৽ or আ • PR͔ΒίϝϯτΛશ݅औಘͯ͠࠷৽ͷ੩తղੳͷ݁Ռͱಥ߹
ϦϦʔε࡞ۀ • ։ൃ͕ऴΘͬͨΒGitHub্ͰReleaseΛ ࡞͢Δ • ϦϙδτϦͷτοϓʹaction.yml͕ଘࡏ ͢ΔͱΞΫγϣϯઐ༻ͷReleaseը໘͕ දࣔ͞ΕΔ • MarketplaceͷpublishΛࢦఆͰ͖Δ
• ymlهड़༰ɺREADMEͷνΣοΫ
ެ։🎉
͋Γ͕ͱ͏͍͟͝·ͨ͠