Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GitHub Actionsと GitHub CLIと permissions
Search
ゆきか
November 22, 2024
Technology
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GitHub Actionsと GitHub CLIと permissions
ゆきか
November 22, 2024
More Decks by ゆきか
See All by ゆきか
新潟の鮨のはなし 飯テロver
yukikayuki
0
350
新潟WEBアプリケーション勉強会 Vol.1 LT GraphQL Federation
yukikayuki
0
150
React Hooks勉強会 vol.5
yukikayuki
2
390
Other Decks in Technology
See All in Technology
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
920
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.7k
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
130
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
860
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
280
Local CI × GitHub Actions
gogutan
2
190
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
260
初海外で注意すべきこと12選!!!安全快適なre:invent生活にするために
yuuuuuuu168
1
160
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
160
AIカンパニーへの転換を支えた、エンジニアの仕事の再定義
kworkdev
PRO
2
1.2k
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
190
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2.2k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
730
Visualization
eitanlees
153
17k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Designing for humans not robots
tammielis
254
26k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
sira's awesome portfolio website redesign presentation
elsirapls
0
450
Marketing to machines
jonoalderson
1
5.9k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
Transcript
GitHub Actionsと GitHub CLIと permissions 2024-11-22 Niigata 5Min Tech #14
@_yukikayuki
自己紹介 KANEDA Takayuki (@_yukikayuki) 株式会社モニクル ソフトウェアエンジニア(Web) + プロダクトSRE 最近メガネを変えた
GitHub ActionsでGitHub CLIを使いたいことあります か?
GitHub Actions(以降GHA)とは > GitHub Actions は、ビルド、テスト、デプロイのパイプラインを自動化でき る継続的インテグレーションと継続的デリバリー (CI/CD) のプラットフォームで す。
リポジトリに対するすべての pull request をビルドしてテストしたり、 マージされた pull request を運用環境にデプロイしたりするワークフローを 作成できます。
利用例 プルリクオープン時のテスト・リント・プレビュー環境へのデプロイ mainブランチへマージした時の本番デプロイ プレビュー環境のクリーニングの定期実行
GitHub CLI(以降ghコマンド)とは > GitHub CLI は、コンピューターのコマンド ラインから GitHub を使用する ためのオープン
ソース ツールです。 コマンドラインから作業しているときは、 GitHub CLI を使用して時間を節約し、コンテキストの切り替えを回避できま す。 できること: Issue と pull request の作成、クローズ、編集、一覧表示、プル リクエストのレビュー、diff、マージなどなど
利用例 リポジトリをクローンする Twitter(現X)で見かけたが、若い人はghコマンドでリポジトリをクローンし ている? ローカルマシンからプルリクを作る gh pr create --title "The
bug is fixed" --body "Everything works again" GHAでリポジトリの情報を取得して何かゴニョゴニョする
GHAでghコマンドを使うには?
jobs: info: runs-on: ubuntu-latest permissions: contents: read pull-requests: read steps:
- uses: actions/checkout@v4 - name: is pr closed shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | pr_number=${{ github.event.pull_request.number }} is_pr_closed=$(gh pr view $pr_number --json closed -q '.closed') echo $is_pr_closed # false
jobs: info: runs-on: ubuntu-latest permissions: # permissionを指定 contents: read pull-requests:
read steps: - uses: actions/checkout@v4 - name: is pr closed shell: bash env: # 以下の形でGH_TOKENを設定 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | pr_number=${{ github.event.pull_request.number }} is_pr_closed=$( gh pr view $pr_number --json closed -q '.closed' ) echo $is_pr_closed # false
permission > 優れたセキュリティ プラクティスとし て、GITHUB_TOKEN に必要最小限の アクセス権を付与することをお勧めしま す。 permissions: actions:
read|write|none attestations: read|write|none checks: read|write|none contents: read|write|none deployments: read|write|none id-token: write|none issues: read|write|none discussions: read|write|none packages: read|write|none pages: read|write|none pull-requests: read|write|none repository-projects: read|write|none security-events: read|write|none statuses: read|write|none
参考URL • https://docs.github.com/ja/actions/about-github-actions/und erstanding-github-actions • https://docs.github.com/ja/github-cli/github-cli/about-github -cli • https://docs.github.com/ja/enterprise-cloud@latest/actions/ writing-workflows/choosing-what-your-workflow-does/contr
olling-permissions-for-github_token