{"id":17835759,"url":"https://github.com/guitarrapc/githubactions-lab","last_synced_at":"2026-02-03T20:03:42.701Z","repository":{"id":39405147,"uuid":"257465468","full_name":"guitarrapc/githubactions-lab","owner":"guitarrapc","description":"github actions ci lab","archived":false,"fork":false,"pushed_at":"2026-02-02T19:26:21.000Z","size":5052,"stargazers_count":54,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-03T09:47:07.169Z","etag":null,"topics":["github-actions"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guitarrapc.png","metadata":{"files":{"readme":"README-ja.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-21T03:04:00.000Z","updated_at":"2026-02-02T19:26:23.000Z","dependencies_parsed_at":"2024-02-09T01:44:52.783Z","dependency_job_id":"672b50f5-3edf-4785-b2a7-e6b5cdce5825","html_url":"https://github.com/guitarrapc/githubactions-lab","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/guitarrapc/githubactions-lab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarrapc%2Fgithubactions-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarrapc%2Fgithubactions-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarrapc%2Fgithubactions-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarrapc%2Fgithubactions-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guitarrapc","download_url":"https://codeload.github.com/guitarrapc/githubactions-lab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarrapc%2Fgithubactions-lab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29055619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions"],"created_at":"2024-10-27T20:26:03.010Z","updated_at":"2026-02-03T20:03:42.689Z","avatar_url":"https://github.com/guitarrapc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![auto doc](https://github.com/guitarrapc/githubactions-lab/actions/workflows/auto-doc.yaml/badge.svg)](https://github.com/guitarrapc/githubactions-lab/actions/workflows/auto-doc.yaml)\n[![auto dump context](https://github.com/guitarrapc/githubactions-lab/actions/workflows/auto-dump-context.yaml/badge.svg)](https://github.com/guitarrapc/githubactions-lab/actions/workflows/auto-dump-context.yaml)\n[![actionlint](https://github.com/guitarrapc/githubactions-lab/actions/workflows/actionlint.yaml/badge.svg)](https://github.com/guitarrapc/githubactions-lab/actions/workflows/actionlint.yaml)\n\n[English](./README.md) | 日本語\n\n# githubactions-lab\n\nGitHub Actionsの研究とテストラボです。\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n# Table of Contents\n\n- [まだサポートされていない機能](#%E3%81%BE%E3%81%A0%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%81%AA%E3%81%84%E6%A9%9F%E8%83%BD)\n  - [ビュー](#%E3%83%93%E3%83%A5%E3%83%BC)\n  - [機能](#%E6%A9%9F%E8%83%BD)\n  - [プラン制限](#%E3%83%97%E3%83%A9%E3%83%B3%E5%88%B6%E9%99%90)\n- [GitHub ActionsへのCIの移行](#github-actions%E3%81%B8%E3%81%AEci%E3%81%AE%E7%A7%BB%E8%A1%8C)\n- [GitHub Actions vs 他のCIプラットフォーム](#github-actions-vs-%E4%BB%96%E3%81%AEci%E3%83%97%E3%83%A9%E3%83%83%E3%83%88%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0)\n  - [コアワークフロー機能](#%E3%82%B3%E3%82%A2%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E6%A9%9F%E8%83%BD)\n  - [セキュリティとアクセス制御](#%E3%82%BB%E3%82%AD%E3%83%A5%E3%83%AA%E3%83%86%E3%82%A3%E3%81%A8%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%E5%88%B6%E5%BE%A1)\n  - [インフラストラクチャとパフォーマンス](#%E3%82%A4%E3%83%B3%E3%83%95%E3%83%A9%E3%82%B9%E3%83%88%E3%83%A9%E3%82%AF%E3%83%81%E3%83%A3%E3%81%A8%E3%83%91%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%B3%E3%82%B9)\n  - [開発体験](#%E9%96%8B%E7%99%BA%E4%BD%93%E9%A8%93)\n- [基本 - オンボーディング](#%E5%9F%BA%E6%9C%AC---%E3%82%AA%E3%83%B3%E3%83%9C%E3%83%BC%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0)\n  - [runステップ](#run%E3%82%B9%E3%83%86%E3%83%83%E3%83%97)\n  - [ifセクション](#if%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3)\n  - [ランナーのサイズ設定](#%E3%83%A9%E3%83%B3%E3%83%8A%E3%83%BC%E3%81%AE%E3%82%B5%E3%82%A4%E3%82%BA%E8%A8%AD%E5%AE%9A)\n  - [Timeout](#timeout)\n- [基本 - 基礎](#%E5%9F%BA%E6%9C%AC---%E5%9F%BA%E7%A4%8E)\n  - [デフォルトシェル](#%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%82%B7%E3%82%A7%E3%83%AB)\n  - [コンテキストメタデータのダンプ](#%E3%82%B3%E3%83%B3%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%83%A1%E3%82%BF%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AE%E3%83%80%E3%83%B3%E3%83%97)\n  - [スクリプト内の環境変数](#%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E5%86%85%E3%81%AE%E7%92%B0%E5%A2%83%E5%A4%89%E6%95%B0)\n  - [実行順序](#%E5%AE%9F%E8%A1%8C%E9%A0%86%E5%BA%8F)\n  - [ジョブ出力](#%E3%82%B8%E3%83%A7%E3%83%96%E5%87%BA%E5%8A%9B)\n  - [冗長制御](#%E5%86%97%E9%95%B7%E5%88%B6%E5%BE%A1)\n  - [前のジョブが成功したときに実行](#%E5%89%8D%E3%81%AE%E3%82%B8%E3%83%A7%E3%83%96%E3%81%8C%E6%88%90%E5%8A%9F%E3%81%97%E3%81%9F%E3%81%A8%E3%81%8D%E3%81%AB%E5%AE%9F%E8%A1%8C)\n  - [前のステップステータスが特定の場合に実行](#%E5%89%8D%E3%81%AE%E3%82%B9%E3%83%86%E3%83%83%E3%83%97%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9%E3%81%8C%E7%89%B9%E5%AE%9A%E3%81%AE%E5%A0%B4%E5%90%88%E3%81%AB%E5%AE%9F%E8%A1%8C)\n  - [Matrix](#matrix)\n  - [手動実行のためのWorkflow dispatch](#%E6%89%8B%E5%8B%95%E5%AE%9F%E8%A1%8C%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AEworkflow-dispatch)\n- [Basic - Commit, Branch and Tag handling](#basic---commit-branch-and-tag-handling)\n  - [リリースを作成する](#%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%B9%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B)\n  - [ファイル変更を検出する](#%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%A4%89%E6%9B%B4%E3%82%92%E6%A4%9C%E5%87%BA%E3%81%99%E3%82%8B)\n  - [非デフォルトブランチでのスケジュールジョブ](#%E9%9D%9E%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E3%81%A7%E3%81%AE%E3%82%B9%E3%82%B1%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%B8%E3%83%A7%E3%83%96)\n  - [ブランチプッシュのみをトリガーし、タグプッシュではスキップ](#%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E3%81%AE%E3%81%BF%E3%82%92%E3%83%88%E3%83%AA%E3%82%AC%E3%83%BC%E3%81%97%E3%82%BF%E3%82%B0%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E3%81%A7%E3%81%AF%E3%82%B9%E3%82%AD%E3%83%83%E3%83%97)\n  - [コミットメッセージでトリガーする](#%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%81%A7%E3%83%88%E3%83%AA%E3%82%AC%E3%83%BC%E3%81%99%E3%82%8B)\n  - [タグプッシュのみをトリガーし、ブランチプッシュではスキップ](#%E3%82%BF%E3%82%B0%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E3%81%AE%E3%81%BF%E3%82%92%E3%83%88%E3%83%AA%E3%82%AC%E3%83%BC%E3%81%97%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E3%81%A7%E3%81%AF%E3%82%B9%E3%82%AD%E3%83%83%E3%83%97)\n  - [特定のタグパターンでトリガーする](#%E7%89%B9%E5%AE%9A%E3%81%AE%E3%82%BF%E3%82%B0%E3%83%91%E3%82%BF%E3%83%BC%E3%83%B3%E3%81%A7%E3%83%88%E3%83%AA%E3%82%AC%E3%83%BC%E3%81%99%E3%82%8B)\n- [Basic - Issue and Pull Request handling](#basic---issue-and-pull-request-handling)\n  - [プルリクエストのラベルを検出する](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%83%A9%E3%83%99%E3%83%AB%E3%82%92%E6%A4%9C%E5%87%BA%E3%81%99%E3%82%8B)\n  - [プルリクエストのタイトルでCIをスキップする](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E3%81%A7ci%E3%82%92%E3%82%B9%E3%82%AD%E3%83%83%E3%83%97%E3%81%99%E3%82%8B)\n  - [フォークリポジトリからのPRをスキップ](#%E3%83%95%E3%82%A9%E3%83%BC%E3%82%AF%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%8B%E3%82%89%E3%81%AEpr%E3%82%92%E3%82%B9%E3%82%AD%E3%83%83%E3%83%97)\n  - [ドラフトPR時にジョブをスキップ](#%E3%83%89%E3%83%A9%E3%83%95%E3%83%88pr%E6%99%82%E3%81%AB%E3%82%B8%E3%83%A7%E3%83%96%E3%82%92%E3%82%B9%E3%82%AD%E3%83%83%E3%83%97)\n- [高度な機能](#%E9%AB%98%E5%BA%A6%E3%81%AA%E6%A9%9F%E8%83%BD)\n  - [Dependabotによる自動Actionsバージョン更新](#dependabot%E3%81%AB%E3%82%88%E3%82%8B%E8%87%AA%E5%8B%95actions%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E6%9B%B4%E6%96%B0)\n  - [Build Artifacts](#build-artifacts)\n  - [並行制御](#%E4%B8%A6%E8%A1%8C%E5%88%B6%E5%BE%A1)\n  - [コンテナジョブ](#%E3%82%B3%E3%83%B3%E3%83%86%E3%83%8A%E3%82%B8%E3%83%A7%E3%83%96)\n  - [Custom actions](#custom-actions)\n  - [Custom actions - JavaScript Actions](#custom-actions---javascript-actions)\n  - [Data passing](#data-passing)\n  - [他のリポジトリのワークフローをディスパッチする](#%E4%BB%96%E3%81%AE%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AE%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E3%82%92%E3%83%87%E3%82%A3%E3%82%B9%E3%83%91%E3%83%83%E3%83%81%E3%81%99%E3%82%8B)\n  - [フォークユーザーのワークフロー変更防止](#%E3%83%95%E3%82%A9%E3%83%BC%E3%82%AF%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%AE%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E5%A4%89%E6%9B%B4%E9%98%B2%E6%AD%A2)\n  - [git checkoutの高速化](#git-checkout%E3%81%AE%E9%AB%98%E9%80%9F%E5%8C%96)\n  - [GitHub Step Summary](#github-step-summary)\n  - [PR info from Merge Commit](#pr-info-from-merge-commit)\n  - [Reusable workflow](#reusable-workflow)\n  - [ワークフローコマンド](#%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89)\n  - [YAMLアンカー](#yaml%E3%82%A2%E3%83%B3%E3%82%AB%E3%83%BC)\n- [Security](#security)\n  - [Checkout without persist-credentials](#checkout-without-persist-credentials)\n  - [Personal Access Tokenの代わりにGitHub App Token](#personal-access-token%E3%81%AE%E4%BB%A3%E3%82%8F%E3%82%8A%E3%81%ABgithub-app-token)\n  - [コンテキスト経由のインジェクション攻撃](#%E3%82%B3%E3%83%B3%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E7%B5%8C%E7%94%B1%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B8%E3%82%A7%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E6%94%BB%E6%92%83)\n  - [ワークフロー内のアクションを最新に保つ](#%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E5%86%85%E3%81%AE%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E6%9C%80%E6%96%B0%E3%81%AB%E4%BF%9D%E3%81%A4)\n  - [GitHub Actionsワークフローのリント](#github-actions%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E3%81%AE%E3%83%AA%E3%83%B3%E3%83%88)\n  - [外部プロバイダーへのアクセスのためのOIDC接続](#%E5%A4%96%E9%83%A8%E3%83%97%E3%83%AD%E3%83%90%E3%82%A4%E3%83%80%E3%83%BC%E3%81%B8%E3%81%AE%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AEoidc%E6%8E%A5%E7%B6%9A)\n  - [Permissions](#permissions)\n  - [Pin Third-Party Actions to Commit SHA](#pin-third-party-actions-to-commit-sha)\n- [Cheat Sheet](#cheat-sheet)\n  - [Actions naming](#actions-naming)\n  - [Actionsランナー情報](#actions%E3%83%A9%E3%83%B3%E3%83%8A%E3%83%BC%E6%83%85%E5%A0%B1)\n  - [プルリクエスト(PR)がフォークかどうかを検出する](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88pr%E3%81%8C%E3%83%95%E3%82%A9%E3%83%BC%E3%82%AF%E3%81%8B%E3%81%A9%E3%81%86%E3%81%8B%E3%82%92%E6%A4%9C%E5%87%BA%E3%81%99%E3%82%8B)\n  - [ダウンロードされたリモートアクションをデバッグする](#%E3%83%80%E3%82%A6%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89%E3%81%95%E3%82%8C%E3%81%9F%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%99%E3%82%8B)\n  - [式での文字列連結](#%E5%BC%8F%E3%81%A7%E3%81%AE%E6%96%87%E5%AD%97%E5%88%97%E9%80%A3%E7%B5%90)\n  - [ブランチを取得する](#%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B)\n  - [タグを取得する](#%E3%82%BF%E3%82%B0%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B)\n  - [ワークフロー名を取得する](#%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E5%90%8D%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B)\n  - [ワークフローURLを取得する](#%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BCurl%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B)\n  - [ジョブURLを取得する](#%E3%82%B8%E3%83%A7%E3%83%96url%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B)\n  - [GitHub Actionsのコミットアイコン](#github-actions%E3%81%AE%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88%E3%82%A2%E3%82%A4%E3%82%B3%E3%83%B3)\n  - [ダウンロードされたリモートアクションのパス](#%E3%83%80%E3%82%A6%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89%E3%81%95%E3%82%8C%E3%81%9F%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E3%83%91%E3%82%B9)\n  - [古いIssueとPRの自動クローズ](#%E5%8F%A4%E3%81%84issue%E3%81%A8pr%E3%81%AE%E8%87%AA%E5%8B%95%E3%82%AF%E3%83%AD%E3%83%BC%E3%82%BA)\n  - [GitHubワークフロー実行のテレメトリー](#github%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E5%AE%9F%E8%A1%8C%E3%81%AE%E3%83%86%E3%83%AC%E3%83%A1%E3%83%88%E3%83%AA%E3%83%BC)\n  - [AquaでGitHub Actionsのツール管理](#aqua%E3%81%A7github-actions%E3%81%AE%E3%83%84%E3%83%BC%E3%83%AB%E7%AE%A1%E7%90%86)\n  - [fromJsonを使用した型変換](#fromjson%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%9F%E5%9E%8B%E5%A4%89%E6%8F%9B)\n  - [GitHub Actionsのスケジュールワークフロー一覧を取得したい](#github-actions%E3%81%AE%E3%82%B9%E3%82%B1%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E4%B8%80%E8%A6%A7%E3%82%92%E5%8F%96%E5%BE%97%E3%81%97%E3%81%9F%E3%81%84)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n# まだサポートされていない機能\n\n## ビュー\n- [ ] ワークフロー概要ステータスビュー\n  - ワークフローステータスの概要ビューがありません。Jenkinsはジョブステータスのビューを提供しており、1ステップで現在のステータスを把握できます。\n  - 回避策: なし。\n- [ ] GitHub Actionsワークフロービューのグループ化\n  - GitHub Actionsワークフローをグループ化できません。\n  - 回避策: なし。\n- [ ] テストインサイトビュー\n  - [CircleCI](https://circleci.com/docs/insights-tests)や[Azure Pipeline](https://docs.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=azure-devops)が提供するようなテストインサイトビューがありません。\n  - 回避策: [$GITHUB_STEP_SUMMARY](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/)を使用してください。\n\n## 機能\n- [ ] ワークフローレベルの`timeout-minutes`\n  - 現在、timeout-minutesはジョブとステップに設定できますが、ワークフロー全体のデフォルト360分を変更できません。\n  - 回避策: なし。すべてのジョブに`timeout-minutes`を設定してください。\n- [ ] ワークフロー並行制御のカスタマイズ\n  - 現在、並行制御は`key`と`cancel-in-progress`オプションで処理できます。少なくとも1つの保留中のジョブが存在する場合、アクションは終了します。ただし、保留中のアクションの数をカスタマイズしたり、保留中のジョブのキャンセルを防止したりすることはできません。\n  - 回避策: なし。\n- [ ] SSHデバッグ\n  - [CircleCIが提供](https://circleci.com/docs/ssh-access-jobs)するようなSSHデバッグ機能がありません。\n  - 回避策: [Debugging with ssh Actions](https://github.com/marketplace/actions/debugging-with-ssh)を使用してください。\n- [x] 動的設定\n  - CircleCIは[Dynamic Config](https://circleci.com/docs/dynamic-config)を提供しており、セットアップワークフロー、[path-filtering orb](https://circleci.com/developer/orbs/orb/circleci/path-filtering)によるパスフィルタリング、[continuation orb](https://circleci.com/developer/orbs/orb/circleci/continuation)が利用できます。2023年12月1日以降に作成されたプロジェクトではデフォルトで有効です。\n  - GitHub Actionsは同様の機能を提供しています: 再利用可能なワークフロー/入力パラメータを持つComposite Actions、および条件付きワークフロー実行。\n\n## プラン制限\n\n### GitHub Team Plan, GitHub Pro Plan\n\n- [ ] `Environment \u003e Deployment protection rules`はGitHub Team/Proプランでは利用できません。`Required reviewers`（承認）と`Wait timer`を使用できません。プライベートリポジトリでこれらの機能を使用するには、GitHub Enterpriseプランが必要です。\n\n\u003cdetails\u003e\u003csummary\u003e詳細を表示するにはクリック\u003c/summary\u003e\n\n**プライベートリポジトリ**\n\nEnvironment protection rulesで`Required reviewers`と`Wait timer`が使用できません。\n\n![Environment Private Repository](./images/environment-private-repo.png)\n\n**パブリックリポジトリ**\n\nEnvironment protection rulesで`Required reviewers`と`Wait timer`が使用できます。\n\n![Environment Public Repository](./images/environment-public-repo.png)\n\n\u003c/details\u003e\n\n---\n\n# GitHub ActionsへのCIの移行\n\n移行に関するいくつかのドキュメントがあります。\n\n- CircleCI -\u003e GitHub Actions: [Migrating from CircleCI to GitHub Actions \\- GitHub Help](https://help.github.com/en/actions/migrating-to-github-actions/migrating-from-circleci-to-github-actions)\n- Azure pipeline -\u003e GitHub Actions: [Migrating from Azure Pipelines to GitHub Actions \\- GitHub Help](https://help.github.com/en/actions/migrating-to-github-actions/migrating-from-azure-pipelines-to-github-actions)\n- GitLab -\u003e GitHub Actions: [Migrating from GitLab CI/CD to GitHub Actions \\- GitHub Docs](https://docs.github.com/en/actions/migrating-to-github-actions/migrating-from-gitlab-cicd-to-github-actions)\n- Jenkins -\u003e GitHub Actions: [Migrating from Jenkins to GitHub Actions \\- GitHub Help](https://help.github.com/en/actions/migrating-to-github-actions/migrating-from-jenkins-to-github-actions)\n\nGitHub Actionsからの移行も検討できます。\n\n- GitHub Actions -\u003e CircleCI: [Migrating from Github Actions \\- CircleCI](https://circleci.com/docs/migrating-from-github)\n\n# GitHub Actions vs 他のCIプラットフォーム\n\nCIプラットフォーム間の主要機能の簡単な比較表:\n\n| Feature | GitHub Actions | CircleCI | Azure Pipeline | Jenkins |\n|---------|---------------|----------|----------------|---------|\n| **Core Workflow** |\n| YAML-based config | ✔️ | ✔️ | ✔️ | ❌ Groovy |\n| Trigger Push \u0026 PR | ✔️ | ❌ | ✔️ | ⚠️ Separate |\n| Reusable workflows | ✔️ Multiple | ✔️ | ✔️ | ⚠️ Complex |\n| Path filter | ✔️ Built-in | ⚠️ Orb | ✔️ Built-in | ❌ |\n| Concurrency control | ✔️ Built-in | ✔️ | ✔️ Stage-level | ⚠️ Built-in |\n| Re-run failed jobs | ✔️ | ✔️ | ✔️ Single stage | ⚠️ Job-level |\n| **Security** |\n| Fork PR handling | ✔️ Approved | ⚠️ Limited | ✔️ | ❌ |\n| Secrets management | ✔️ 3 scopes | ✔️ Context | ✔️ | ✔️ |\n| Job approval | ⚠️ Paid plan | ✔️ | ✔️ | ✔️ |\n| **Infrastructure** |\n| Runner sizing | ✔️ Configurable | ✔️ | ❌ Fixed | N/A |\n| Git sparse checkout | ✔️ | ❌ | ❌ | ✔️ |\n| Git shallow clone | ✔️ Default | ✔️ Blobless | ✔️ Default | ✔️ |\n| **Development** |\n| Step output | ✔️ Dedicated | ⚠️ Env only | ✔️ | ⚠️ Env only |\n| Job metadata | ✔️ Context | ✔️ Env vars | ✔️ Env vars | ✔️ Env vars |\n| **Build Management** |\n| Artifact retention | ✔️ Configurable | ⚠️ Permanent | ⚠️ Permanent | ⚠️ Configurable |\n| Skip CI keywords | ✔️ 5 types | ✔️ 2 types | ✔️ 3+ types | ⚠️ Plugin |\n\n**凡例:** ✔️ 完全サポート | ⚠️ 制限付き/部分的 | ❌ サポートなし | N/A 該当なし\n\n## コアワークフロー機能\n\n### ジョブとワークフロー\n\n- ✔️ **GitHub Actions**: ジョブはワークフロー内で定義。PushとPR両方をトリガー。\n- ✔️ **CircleCI**: ジョブはワークフロー内で結合。PushとPRを同時にトリガーできない。\n- ✔️ **Azure Pipeline**: ジョブはstageで結合。PushとPR両方をトリガー。\n- ⚠️ **Jenkins**: Declarative Pipeline(Groovy、YAMLではない)を使用。トリガーはパイプライン外で定義。\n\n\u003cdetails\u003e\u003csummary\u003e構文例を表示するにはクリック\u003c/summary\u003e\n\n**GitHub Actions**\n```yaml\nname: workflow name\non:\n  push:\n    branches: [main]\n\njobs:\n  Job_Name:\n    runs-on: ubuntu-latest\n    steps:\n      - run: echo foo\n```\n\n**CircleCI**\n```yaml\nversion: 2.1\n\njobs:\n  Job_Name:\n    docker:\n      - image: cimg/\u003clanguage\u003e:\u003cversion TAG\u003e  # Recommended: cimg/* (new convenience images)\n      # Legacy: circleci/\u003clanguage\u003e:\u003cversion TAG\u003e\n    steps:\n      - run: echo foo\nworkflows:\n  commit:\n    jobs:\n      - Job_Name\n```\n\n**Azure Pipeline**\n```yaml\ntrigger:\n  - main\n\nstages:\n  - stage: StageName\n    jobs:\n      - job: Job_Name\n\njobs:\n  - job: Job_Name\n    pool:\n      vmImage: \"ubuntu-latest\"\n    steps:\n      - bash: echo \"foo\"\n```\n\n**Jenkins**\n```groovy\npipeline {\n  agent any\n  triggers {\n    pollSCM('')\n  }\n  stages {\n    stage('Stage_Name') {\n      steps {\n        sh 'echo foo'\n      }\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n### パスフィルター\n\n変更されたファイルパスに基づいてワークフロー実行をフィルタリング:\n\n- ✔️ **GitHub Actions**: [`on.\u003cevent\u003e.paths`/`paths-ignore`](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths)経由で組み込みサポート\n- ✔️ **CircleCI**: [公式orbでパスフィルタリング](https://circleci.com/developer/orbs/orb/circleci/path-filtering)(動的設定が必要)\n- ✔️ **Azure Pipeline**: 組み込みパスフィルターサポート\n- ❌ **Jenkins**: 組み込みサポートなし。手動実装が必要。\n\n### 再利用可能なジョブとワークフロー\n\n- ✔️ **GitHub Actions**: 複数の再利用オプション: `再利用可能なワークフロー`、`Composite Actions`、`組織ワークフロー`、`YAMLアンカー`\n- ✔️ **CircleCI**: ジョブの再利用と`YAMLアンカー`サポート\n- ✔️ **Azure Pipeline**: stage/job/stepの再利用のためのテンプレートシステム\n- ⚠️ **Jenkins**: パイプライン参照が利用可能だが複雑なことが多い。スクリプトベースの再利用が推奨される。\n\n### 冗長ビルドのキャンセル\n\n- ✔️ **GitHub Actions**: `cancel-in-progress`を使用した組み込み[並行制御](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency)。代替: コミュニティアクション([workflow-run-cleanup-action](https://github.com/marketplace/actions/workflow-run-cleanup-action)など)\n- ✔️ **CircleCI**: 組み込み冗長ビルドキャンセル\n- ✔️ **Azure Pipeline**: [ステージレベルの並行制御](https://learn.microsoft.com/en-us/azure/devops/release-notes/features-timeline)(2024 Q3以降利用可能)\n- ⚠️ **Jenkins**: Declarative Pipelineに組み込み[`disableConcurrentBuilds()`](https://www.jenkins.io/doc/book/pipeline/syntax/#options)オプション。`disableConcurrentBuilds(abortPrevious: true)`で以前のビルドを中止可能\n\n### 失敗したワークフローの再実行\n\n- ✔️ **GitHub Actions**: `ワークフロー全体`、`単一ジョブ`、または`失敗したジョブのみ`を再実行\n- ✔️ **CircleCI**: `ワークフロー全体`または`失敗したジョブのみ`を再実行。また、`max_auto_reruns`と設定可能な遅延を使用した[自動ステップ再試行](https://circleci.com/docs/configuration-reference/#automatic-step-reruns)もサポート\n- ✔️ **Azure Pipeline**: [単一ステージの再実行](https://learn.microsoft.com/en-us/azure/devops/release-notes/features-timeline)(2024 Q1以降利用可能)、手動ステージキューイングサポート\n- ⚠️ **Jenkins**: `ジョブ全体`の再実行(安定版)。[`preserveStashes`](https://www.jenkins.io/doc/book/pipeline/syntax/#options)オプションでステージレベルの再起動が利用可能(実験的機能)\n\n### CIのスキップとコミットメッセージ\n\n- ✔️ **GitHub Actions**: スキップキーワード: `[skip ci]`、`[ci skip]`、`[no ci]`、`[skip actions]`、`[actions skip]`\n- ✔️ **CircleCI**: スキップキーワード: `[skip ci]`、`[ci skip]`\n- ✔️ **Azure Pipeline**: スキップキーワード: `***NO_CI***`、`[skip ci]`、`[ci skip]`、[その他](https://github.com/Microsoft/azure-pipelines-agent/issues/858#issuecomment-475768046)\n- ⚠️ **Jenkins**: [SCM Skipプラグイン](https://plugins.jenkins.io/scmskip/)が必要。デフォルトパターン: `.*\\[ci skip\\].*`(フリースタイルとパイプラインジョブの両方をサポート、カスタマイズ可能な正規表現)\n\n### ビルド成果物の保存\n\n- ✔️ **GitHub Actions**: [actions/upload-artifact](https://github.com/actions/upload-artifact) / [download-artifact](https://github.com/actions/download-artifact)。設定可能な保持期間。\n- ⚠️ **CircleCI**: [`store_artifacts`](https://circleci.com/docs/artifacts/)ステップ。ダウンロードにはAPI呼び出しが必要。保持期間なし。\n- ✔️ **Azure Pipeline**: [`PublishPipelineArtifact`](https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/pipeline-artifacts?view=azure-devops\u0026tabs=yaml) / `DownloadPipelineArtifact`タスク。保持期間なし。\n- ⚠️ **Jenkins**: 保持ポリシーのための[`buildDiscarder`](https://www.jenkins.io/doc/book/pipeline/syntax/#options)を使用した[`archiveArtifacts`](https://www.jenkins.io/doc/pipeline/steps/core/#archiveartifacts-archive-the-artifacts)ステップ。Jenkins UIまたはAPI経由でダウンロード。\n\n---\n\n## セキュリティとアクセス制御\n\n### フォーク処理\n\n- ✔️ **GitHub Actions**: [ワークフロー承認システム](https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)でフォークPRトリガーをサポート。シークレットアクセスのための[実用的なセキュリティパターン](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)を提供。\n- ⚠️ **CircleCI**: フォークPRをサポートするが、`/pull\\/[0-9]+/`のような[ブランチ命名規則による制限](https://circleci.com/docs/oss/#build-pull-requests-from-forked-repositories)がある。シークレットアクセスを安全に処理する簡単な方法がない。\n- ✔️ **Azure Pipeline**: シークレットアクセスで[フォークPRトリガーをサポート](https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops\u0026tabs=yaml#contributions-from-forks)するが、組み込みのセキュリティパターンが不足。\n- ❌ **Jenkins**: パブリックCIには推奨されない。フォークPR処理は優先事項ではない。\n\n### ジョブ承認\n\n- ⚠️ **GitHub Actions**: Environment保護ルール経由で承認をサポート。制限: プライベートリポジトリの`GitHub Team`プランでは利用不可、`GitHub Enterprise`プランが必要。\n- ✔️ **CircleCI**: 完全な承認サポート。\n- ✔️ **Azure Pipeline**: 完全な承認サポート。\n- ✔️ **Jenkins**: 完全な承認サポート。\n\n### ジョブのシークレット設定\n\n- ✔️ **GitHub Actions**: 自動ログマスキング付きのOrganization/Repository/Environment Secrets\n- ✔️ **CircleCI**: 環境変数とContext\n- ✔️ **Azure Pipeline**: 環境変数とパラメータ\n- ✔️ **Jenkins**: Credential Provider\n\n\u003cdetails\u003e\u003csummary\u003eGitHub Actionsのシークレット詳細を表示するにはクリック\u003c/summary\u003e\n\nGitHub Actionsは3つのシークレットスコープをサポート:\n\n- **Organization Secrets**: `Organization \u003e Settings \u003e Secrets`(リポジトリでフィルタリング可能)\n- **Repository Secrets**: `Repository \u003e Settings \u003e Secrets`\n- **Environment Secrets**: `Repository \u003e Environment \u003e Secrets`\n\n**優先順位**: `Environment Secrets` \u003e `Repository Secrets` \u003e `Organization Secrets`\n\n**個人アカウント**: リポジトリごとにシークレットを設定するか、[google/secrets-sync-action](https://github.com/google/secrets-sync-action)を使用。\n\nシークレットは自動的に[ログでマスク](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#masking-a-value-in-a-log)されます。\n\n\u003c/details\u003e\n\n---\n\n## インフラストラクチャとパフォーマンス\n\n### Git Checkout\n\n- ✔️ **GitHub Actions**: [actions/checkout](https://github.com/actions/checkout)はすべての機能をサポート: `ssh/https`、`submodule`、`shallow-clone`(デフォルト深度1)、`sparse checkout`、`lfs`。\n- ✔️ **CircleCI**: [checkout](https://circleci.com/docs/configuration-reference/#checkout)は`ssh/https`、`submodule`、`blobless clone`(2024年以降デフォルト)、`lfs`をサポート。欠落: `sparse-checkout`。`method: blobless`または`method: full`を選択可能。\n- ✔️ **Azure Pipeline**: [checkout](https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-checkout?view=azure-pipelines)は`ssh/https`、`submodule`、`shallow-clone`(2022年9月以降デフォルト深度1)、`lfs`をサポート。欠落: `sparse-checkout`。\n- ✔️ **Jenkins**: [GitSCM](https://www.jenkins.io/doc/pipeline/steps/params/gitscm/)はすべての機能をサポート: `ssh/https`、`submodule`、`shallow-clone`、`sparse checkout`、`lfs`。デフォルト: フルクローン。\n\n### ホストランナーのサイジング\n\n- ✔️ **GitHub Actions**: 設定可能なサイジングと静的IPアドレスを備えた[Single-CPUランナー](https://docs.github.com/en/actions/reference/runners/github-hosted-runners#single-cpu-runners)と[より大きなランナー](https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners)を提供。\n- ✔️ **CircleCI**: 異なるランナーサイズのための[リソースクラス](https://circleci.com/docs/resource-class-overview/)を提供。\n- ⚠️ **Azure Pipeline**: Microsoftホストエージェントの固定サイズ: [Standard_DS2_v2](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted#hardware)(2 vCPU、7GB RAM、14GB SSD)。柔軟なサイジングには、[Managed DevOps Pools](https://learn.microsoft.com/en-us/azure/devops/managed-devops-pools/overview)またはセルフホストエージェントを使用。\n- ❌ **Jenkins**: セルフホストソリューション。ホストランナーの概念は適用されない。\n\n---\n\n## 開発体験\n\n### メタ値とJobId\n\nすべてのCIはジョブメタデータと一意の識別子へのアクセスを提供:\n\n- ✔️ **GitHub Actions**: [Context](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context)`github.run_id`または[環境変数](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables)`GITHUB_RUN_ID`\n- ✔️ **CircleCI**: [環境変数](https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables)`CIRCLE_BUILD_NUM`、`CIRCLE_WORKFLOW_ID`\n- ✔️ **Azure Pipeline**: [環境変数](https://docs.microsoft.com/ja-jp/azure/devops/pipelines/process/run-number?view=azure-devops\u0026tabs=yaml#tokens)`BuildID`\n- ✔️ **Jenkins**: [環境変数](https://wiki.jenkins.io/display/JENKINS/Building+a+software+project)`BUILD_NUMBER`\n\n### 環境変数の設定\n\n- ✔️ **GitHub Actions**: [`$GITHUB_ENV`](https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable)にリダイレクト: `echo \"NAME=value\" \u003e\u003e $GITHUB_ENV`\n- ✔️ **CircleCI**: `$BASH_ENV`にリダイレクト: `echo \"export NAME=value\" \u003e\u003e $BASH_ENV`\n- ✔️ **Azure Pipeline**: task.setvariableを使用: `echo \"##vso[task.setvariable variable=NAME]VALUE\"`\n- ✔️ **Jenkins**: `Env.`オブジェクトを使用\n\n### 出力の設定\n\n専用の出力パラメータでステップ間とジョブ間で値を渡す:\n\n- ✔️ **GitHub Actions**: [`$GITHUB_OUTPUT`](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter)にリダイレクト: `echo \"name=value\" \u003e\u003e \"$GITHUB_OUTPUT\"`。ジョブ間の受け渡しをサポート。\n- ⚠️ **CircleCI**: 専用出力なし。環境変数を使用\n- ✔️ **Azure Pipeline**: `isoutput=true`でtask.setvariableを使用: `echo \"##vso[task.setvariable variable=NAME;isoutput=true]VALUE\"`\n- ⚠️ **Jenkins**: 専用出力なし。環境変数を使用\n\n### PATH環境変数の設定\n\n- ✔️ **GitHub Actions**: `$GITHUB_PATH`にリダイレクト: `echo \"/path/to/dir\" \u003e\u003e \"$GITHUB_PATH\"`\n- ✔️ **CircleCI**: `$BASH_ENV`にリダイレクト: `echo \"export PATH=$GOPATH/bin:$PATH\" \u003e\u003e $BASH_ENV`\n- ✔️ **Azure Pipeline**: task.setvariableを使用: `echo '##vso[task.setvariable variable=path]$(PATH):/dir/to/whatever'`\n- ✔️ **Jenkins**: `Env.`オブジェクトを使用\n\n---\n\n# 基本 - オンボーディング\n\n## runステップ\n\nステップ内でシェルコマンドを実行するために`run:`を使用できます。`run`ステートメントのヒント:\n\n- ステップ名を説明するために`name:`を追加。\n- 複数行で`run`ステートメントを書くために`run: |`を使用。\n- ステップの環境変数を設定するために`env:`を使用。\n\n```yaml\n# .github/workflows/run-basic.yaml\n\nname: run basic\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n\njobs:\n  push:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 5\n    steps:\n      - run: echo \"Hello world!\"\n      - run: |\n          echo \"foo\"\n          echo \"bar\"\n      - name: name to run steps\n        run: |\n          cat \u003c\u003c 'EOF' \u003e script.sh\n          echo \"step 1\"\n          echo \"step 2\"\n          echo \"step 3\"\n          echo \"${FOO}\"\n          EOF\n      - name: execute script\n        run: bash ./script.sh\n        env:\n          FOO: \"This is an environment variable\"\n\n```\n\n## ifセクション\n\n`if:`条件を使用して、`job`/`step`を実行するかどうかを制御できます。`if`ステートメントは`success()`、`failure()`、`contains()`、`startsWith()`などの[式](https://docs.github.com/ja/actions/reference/workflows-and-actions/expressions)構文を使用できます。\n\n次の例は、ジョブレベルとステップレベルで`if`条件を使用する方法を示しています。\n\n```yaml\n# .github/workflows/if-basic.yaml\n\nname: if basic\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n\njobs:\n  push:\n    if: ${{ github.event_name == 'push' || github.event.forced == false }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 5\n    steps:\n      - run: echo \"push\"\n\n  workflow_dispatch:\n    if: ${{ github.event_name == 'workflow_dispatch' }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 5\n    steps:\n      - run: echo \"workflow_dispatch\"\n\n  always:\n    if: ${{ always() }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 5\n    steps:\n      - run: echo \"always\"\n      - run: echo \"this is push\"\n        if: ${{ github.event_name == 'push' }}\n\n```\n\n## ランナーのサイズ設定\n\nGitHubホストランナーには3つのタイプがあります: 標準ランナー、より大きなランナー、シングルCPUランナー。\n\n- 標準ランナーはGitHub Actionsのデフォルトランナーです。ほとんどのジョブに適しています。\n- シングルCPUランナーは、複数のCPUを必要としない軽量なジョブに適しています。分単位のコストを節約できます。\n- より大きなランナーは、より多くのCPUとRAMを必要とするリソース集約的なジョブに適しています。(このドキュメントの範囲外です。)\n- セルフホストランナーは、独自のインフラストラクチャに設定および管理するランナーです。セルフホストランナーのハードウェアおよびソフトウェア構成をカスタマイズして、特定のニーズを満たすことができます。(このドキュメントの範囲外です。)\n\n```yaml\n# .github/workflows/runner-sizing.yaml\n\nname: standard runner\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  standard-runner:\n    permissions:\n      contents: read\n    strategy:\n      matrix:\n        runner: [\"ubuntu-24.04\", \"windows-2025\", \"macos-26\"]\n    runs-on: ${{ matrix.runner }}\n    timeout-minutes: 3\n    steps:\n      - run: echo \"standard runner is suitable for build. ${{ runner.os }}/${{ runner.arch }}\"\n        shell: bash\n\n  single-cpu-runner:\n    permissions:\n      contents: read\n    runs-on: ubuntu-slim\n    timeout-minutes: 3\n    steps:\n      - run: echo \"single-cpu runner is suitable for lightweight tasks, like linting or GitHub API operation. ${{ runner.os }}/${{ runner.arch }}\"\n\n```\n\n\u003cdetails\u003e\u003csummary\u003eランナーサイズの例を表示するにはクリック\u003c/summary\u003e\n\n### 標準ランナー\n\nほとんどのGitHub Actionsジョブは、GitHubホストランナーで実行されます。これらはGitHubが管理・維持する仮想マシン(VM)です。ジョブがトリガーされるたびに新しいVMが作成され、ジョブが実行され、その後VMは破棄されます。\n\nランナータイプとして`ubuntu-latest`、`windows-latest`、`macos-latest`、または`ubuntu-24.04`、`windows-2025`、`macos-26`などの特定バージョンを選択できます。[ランナーの仕様](https://docs.github.com/en/actions/reference/runners/github-hosted-runners#supported-runners-and-hardware-resources)はOSタイプやPublic/Privateリポジトリによって異なります。\n\nまた、`x64`や`arm64`などのアーキテクチャを指定することもできます。詳細は[ドキュメント](https://docs.github.com/en/actions/reference/runners/github-hosted-runners)を参照してください。例:\n\n- Linux x86_64は`ubuntu-24.04`\n- Linux ARM64は`ubuntu-24.04-arm`(Publicリポジトリのみ利用可能)\n- Windows x86_64は`windows-2025`\n- Windows ARM64は`windows-11-arm`(Publicリポジトリのみ利用可能)\n- macOS x86_64は`macos-15-intel`\n- macOS ARM64は`macos-26`\n\n### シングルCPUランナー\n\n複数のCPUを必要としないジョブの分単位コストを節約するために、[シングルCPUランナー](https://docs.github.com/en/actions/reference/runners/github-hosted-runners#single-cpu-runners)を使用できます。シングルCPUランナーは`ubuntu-slim`で利用可能で、タイムアウトは15分です。`ubuntu-slim`ランナーはVMではなく、1 vCPUと5 GB RAMを備えたコンテナベースのランナーです。ドキュメント生成、コードリンティング、静的解析などの軽量なジョブに適しています。\n\n### より大きなランナー\n\n組織ユーザー向けに、[より大きなランナー](https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners)がリソース集約的なジョブに利用可能で、より高いパフォーマンスを必要とするビルドとテストジョブを実行できます。x86_64およびARMアーキテクチャ用のUbuntu、Windowsを選択できます。\n\n`Organization \u003e Settings \u003e Actions \u003e Runners \u003e Larger runners`ページでより大きなランナーの登録を設定できます。\n\n![](./images/settings-runners.png)\n\n次のスクリーンショットは、デフォルトのより大きなランナータイプとその仕様を示しています。\n\n![](./images/larger-hosted-runners-list.png)\n\n他の仕様が必要な場合は、カスタムのより大きなランナータイプを作成できます。次のスクリーンショットは、ubuntu arm64のより大きなランナー作成例を示しています。\n\n![](./images/larger-hosted-runners-spec.png)\n\n指定した名前で`runs-on:`を指定することで、ワークフロー内でより大きなランナーを使用できます。\n\n\u003c/details\u003e\n\n## Timeout\n\n`jobs.\u003cjob_id\u003e.timeout-minutes`で[ジョブタイムアウト](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idtimeout-minutes)を、`steps.timeout-minutes`で[ステップタイムアウト](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepstimeout-minutes)を設定できます。デフォルトのタイムアウトは360分(6時間)です。1から4320分(30日)までの値を設定できます。ビルド時間の無駄を避けるために、すべてのジョブに適切なタイムアウトを設定することをお勧めします。\n\n次の例は、ジョブとステップにタイムアウトを設定する方法を示しています。\n\n```yaml\n# .github/workflows/timeout.yaml\n\nname: timeout\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  my-job:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 5 # timeout for job\n    steps:\n      - run: echo \"done before timeout\"\n        timeout-minutes: 1 # timeout for step\n\n```\n\n# 基本 - 基礎\n\n## デフォルトシェル\n\n`shell:`で`run`ステップのシェルタイプを選択できます。また、`defaults.run.shell:`で`run`ステップのデフォルトシェルタイプを設定することもできます。\n\n[デフォルト](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#defaultsrunshell)でいくつかのシェルタイプが利用可能です。次の例は、`bash`、`pwsh`、`cmd`の設定方法を示しています。\n\n**個人的な推奨:**\n\n現在のAIブームを考慮すると、すべてのオペレーティングシステムでデフォルトシェルとして`bash`を使用するのが最善です。WindowsでPowerShellを使用する必要がある場合は、エンコーディングの問題を避けるため、可能な限り`pwsh`を使用することをお勧めします。\n\n```yaml\n# .github/workflows/default-shell.yaml\n\nname: default shell\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\nenv:\n  BRANCH_NAME: ${{ startsWith(github.event_name, 'pull_request') \u0026\u0026 github.head_ref || github.ref_name }}\n\njobs:\n  bash:\n    strategy:\n      matrix:\n        runs-on: [ubuntu-24.04, windows-2025]\n    permissions:\n      contents: read\n    runs-on: ${{ matrix.runs-on }}\n    timeout-minutes: 3\n    defaults:\n      run:\n        shell: bash\n    steps:\n      - name: Add ENV and OUTPUT by shell\n        id: shell\n        run: |\n          echo \"BRANCH=${{ env.BRANCH_NAME }}\" | tee -a \"$GITHUB_ENV\"\n          echo \"branch=${{ env.BRANCH_NAME }}\" | tee -a \"$GITHUB_OUTPUT\"\n      - name: Show ENV and OUTPUT\n        run: |\n          echo ${{ env.BRANCH }}\n          echo ${{ steps.shell.outputs.branch }}\n      - name: Add PATH\n        run: echo \"$HOME/foo/bar\" | tee -a \"$GITHUB_PATH\"\n      - name: Show PATH\n        run: echo \"$PATH\"\n      - name: Show PATH overwrite shell to pwsh\n        run: echo \"${env:PATH}\"\n        shell: pwsh\n\n  pwsh:\n    strategy:\n      matrix:\n        runs-on: [ubuntu-24.04, windows-2025]\n    permissions:\n      contents: read\n    runs-on: ${{ matrix.runs-on }}\n    timeout-minutes: 3\n    defaults:\n      run:\n        shell: pwsh\n    steps:\n      - name: Add ENV and OUTPUT by shell\n        id: shell\n        run: |\n          echo \"BRANCH=${{ env.BRANCH_NAME }}\" | Tee-Object -Append -FilePath \"${env:GITHUB_ENV}\"\n          echo \"branch=${{ env.BRANCH_NAME }}\" | Tee-Object -Append -FilePath \"${env:GITHUB_OUTPUT}\"\n      - name: Show ENV and OUTPUT\n        run: |\n          echo \"${{ env.BRANCH }}\"\n          echo \"${{ steps.shell.outputs.branch }}\"\n      - name: Add PATH\n        run: echo \"$HOME/foo/bar\" | Tee-Object -Append -FilePath \"${env:GITHUB_PATH}\"\n      - name: Show PATH\n        run: echo \"${env:PATH}\"\n      - name: Show PATH overwrite shell to bash\n        run: echo \"$PATH\"\n        shell: bash\n\n```\n\n## コンテキストメタデータのダンプ\n\nコンテキストを使用して、ジョブID、名前、その他のシステム情報を取得します。\nスクリプト内で`github`コンテキストを直接参照できないことに注意してください。\n\n\u003e 参照: [Context and expression syntax for GitHub Actions \\- GitHub Help](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context)\n\n**コンテキスト値へのアクセス**\n\n`${{ CONTEXT_NAME.FIELD }}`でコンテキスト値を取得できます。例: `${{ github.repository }}`\n\n```yaml\n# .github/workflows/context-github.yaml\n\nname: \"context github\"\non:\n  issue_comment:\n    types: [created]\n  push:\n    branches: [\"main\"]\n    tags: [\"*\"]\n  pull_request:\n    branches: [\"main\"]\n    types: [opened, synchronize, reopened, closed]\n  schedule:\n    - cron: \"0 0 * * 1\"\n  workflow_dispatch:\n\njobs:\n  context:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - name: job\n        run: echo \"$GITHUB_JOB\"\n        env:\n          GITHUB_JOB: ${{ github.job }}\n      - name: ref\n        run: echo \"$GITHUB_REF\"\n        env:\n          GITHUB_REF: ${{ github.ref }}\n      - name: sha\n        run: echo ${{ github.sha }}\n      - name: repository\n        run: echo ${{ github.repository }}\n      - name: repository_owner\n        run: echo ${{ github.repository_owner }}\n      - name: actor\n        run: echo \"$GITHUB_ACTOR\"\n        env:\n          GITHUB_ACTOR: ${{ github.actor }}\n      - name: run_id\n        run: echo ${{ github.run_id }}\n      - name: workflow\n        run: echo \"$GITHUB_WORKFLOW\"\n        env:\n          GITHUB_WORKFLOW: ${{ github.workflow }}\n      - name: event_name\n        run: echo ${{ github.event_name }}\n      - name: event.ref\n        run: echo \"$GITHUB_EVENT_REF\"\n        env:\n          GITHUB_EVENT_REF: ${{ github.event.ref }}\n      - name: action\n        run: echo \"$GITHUB_ACTION\"\n        env:\n          GITHUB_ACTION: ${{ github.action }}\n\n```\n\n**JSONとしてのコンテキスト**\n\nコンテキスト値をJSONで表示するには、`toJson(\u003cCONTEXT\u003e)`を使用します。\n\n```yaml\n# .github/workflows/dump-context.yaml\n\nname: dump context\non:\n    issues:\n        types: [opened, transferred, closed]\n    issue_comment:\n        types: [created]\n    push:\n        branches: [\"main\"]\n        tags: [\"*\"]\n    pull_request:\n        branches: [\"main\"]\n        types: [opened, synchronize, reopened, closed]\n    pull_request_target: # zizmor: ignore[dangerous-triggers]\n        branches: [\"main\"]\n        types: [opened, synchronize, reopened, closed]\n    release:\n        types: [created, published]\n    schedule:\n        - cron: \"0 0 * * 1\"\n    workflow_dispatch:\n\njobs:\n    dump:\n        permissions:\n            contents: read\n        runs-on: ubuntu-24.04\n        timeout-minutes: 3\n        steps:\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  persist-credentials: false\n            - name: Dump environment\n              run: env\n            - name: Dump GITHUB_EVENT_PATH json\n              run: cat \"$GITHUB_EVENT_PATH\"\n            - name: Dump GitHub context\n              run: echo \"$CONTEXT\"\n              env:\n                  CONTEXT: ${{ toJson(github) }}\n            - name: Dump job context\n              run: echo \"$CONTEXT\"\n              env:\n                  CONTEXT: ${{ toJson(job) }}\n            - name: Dump steps context\n              run: echo \"$CONTEXT\"\n              env:\n                  CONTEXT: ${{ toJson(steps) }}\n            - name: Dump runner context\n              run: echo \"$CONTEXT\"\n              env:\n                  CONTEXT: ${{ toJson(runner) }}\n            - name: Dump strategy context\n              run: echo \"$CONTEXT\"\n              env:\n                  CONTEXT: ${{ toJson(strategy) }}\n            - name: Dump matrix context\n              run: echo \"$CONTEXT\"\n              env:\n                  CONTEXT: ${{ toJson(matrix) }}\n\n```\n\n**環境変数**\n\n環境変数`GITHUB_EVENT_PATH`からGitHub Eventコンテキストを取得できます。\n\n## スクリプト内の環境変数\n\n[次のステップの環境変数を設定](#次のステップの環境変数を設定)では、次のステップの環境変数を設定する方法を説明しています。\nこの構文はスクリプト内に記述できます。`.github/scripts/setenv.sh`を見てみましょう。\n\n```bash\n# .github/scripts/setenv.sh\n\n#!/bin/bash\nset -eux\n\nwhile [ $# -gt 0 ]; do\n  case $1 in\n    --ref) GITHUB_REF=$2; shift 2; ;;\n    *) shift ;;\n  esac\ndone\n\necho BRANCH_SCRIPT=${GITHUB_REF} | tee -a \"$GITHUB_ENV\"\necho branch=${GITHUB_REF} | tee -a \"$GITHUB_OUTPUT\"\n\n```\n\nこのスクリプトをワークフローから呼び出します。\n\n```yaml\n# .github/workflows/setenv-script.yaml\n\nname: set env with script\non:\n    workflow_dispatch:\n    push:\n        branches: [\"main\"]\n    pull_request:\n        branches: [\"main\"]\n\nenv:\n    BRANCH_NAME: ${{ startsWith(github.event_name, 'pull_request') \u0026\u0026 github.head_ref || github.ref_name }}\n\njobs:\n    bash:\n        strategy:\n            matrix:\n                runs-on: [ubuntu-24.04, windows-2025]\n        permissions:\n            contents: read\n        runs-on: ${{ matrix.runs-on }}\n        timeout-minutes: 3\n        defaults:\n            run:\n                shell: bash\n        steps:\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  persist-credentials: false\n            - name: Add ENV and OUTPUT by Script\n              id: script\n              run: bash ./.github/scripts/setenv.sh --ref \"${{ env.BRANCH_NAME }}\"\n            - name: Show Script  ENV and OUTPUT\n              run: |\n                  echo ${{ env.BRANCH_SCRIPT }}\n                  echo ${{ steps.script.outputs.branch }}\n\n    pwsh:\n        strategy:\n            matrix:\n                runs-on: [ubuntu-24.04, windows-2025]\n        permissions:\n            contents: read\n        runs-on: ${{ matrix.runs-on }}\n        timeout-minutes: 3\n        defaults:\n            run:\n                shell: pwsh\n        steps:\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  persist-credentials: false\n            - name: Add ENV and OUTPUT by Script\n              id: script\n              run: ./.github/scripts/setenv.ps1 -Ref \"${{ env.BRANCH_NAME }}\"\n            - name: Show Script ENV and OUTPUT\n              run: |\n                  echo \"${{ env.BRANCH_SCRIPT }}\"\n                  echo \"${{ steps.script.outputs.branch }}\"\n\n```\n\n## 実行順序\n\nGitHub Actionsワークフローの実行順序は`ワークフロー` -\u003e `ジョブ` -\u003e `ステップ`です。\n\n- ワークフローはデフォルトで並列実行されますが、`on.workflow_call`で定義された[workflow_call](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_call)イベントでワークフロー実行順序を制御できます。\n- ジョブはデフォルトで並列実行されますが、`jobs.\u003cjob_id\u003e.needs`で定義された[needs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds)でジョブ実行順序を制御できます。\n- ステップは各ジョブ内で順次実行されます。\n\n### workflow_callでワークフロー実行順序を制御\n\nワークフローに`on.workflow_call`セクションがない場合、他のワークフローと並列実行されます。`on.workflow_call`セクションを追加すると、そのワークフローは他のワークフローから呼び出すことができます。その結果、ワークフローは呼び出し元ワークフロー -\u003e 呼び出し先ワークフローの順序で順次実行されます。\n\n実際のサンプルは[workflow_call](#再利用可能なワークフロー)セクションを参照してください。\n\n\u003e [!WARNING]\n\u003e `workflow_run`イベントを使用してワークフロー実行順序を制御することは避けることを検討してください。[公式ドキュメント](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_run)に記載されているように、`workflow_run`トリガーで信頼できないコードを実行すると、セキュリティ脆弱性につながる可能性があります。これらの脆弱性には、キャッシュポイズニングや書き込み特権またはシークレットへの意図しないアクセスの付与が含まれます。\n\n### needsでジョブ実行順序を制御\n\nジョブに`needs`セクションがない場合、他のジョブと並列実行されます。`needs`セクションを設定すると、そのジョブは`needs`セクションで定義された前のジョブの後に実行されます。デフォルトでは、`needs`を持つジョブは前のジョブが成功することを必要とします。\n\n次の例のフローでは、`job2`は`job1`が成功した後に実行され、`job3`は`job1`と`job2`の両方が成功した後に実行されます。これは、`job1`が失敗した場合は`job2`と`job3`が実行されず、`job2`が失敗した場合は`job3`が実行されないことを意味します。その結果、ジョブは`job1` -\u003e `job2` -\u003e `job3`の順序で順次実行されます。\n\n```yaml\njobs:\n  job1:\n  job2:\n    needs: job1\n  job3:\n    needs: [job1, job2]\n```\n\n\\u5b9f\\u969b\\u306e\\u30b5\\u30f3\\u30d7\\u30eb\\u3092\\u53c2\\u7167\\u3057\\u3066\\u304f\\u3060\\u3055\\u3044\\u3002\n\n```yaml\n# .github/workflows/job-needs-basic.yaml\n\nname: job needs basic\n\non:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n  workflow_dispatch:\n\njobs:\n  A:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"a\"\n\n  B:\n    needs: [A]\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"b\"\n\n  # Run only if A and B success\n  C:\n    needs: [A, B]\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"c\"\n\n```\n\n### 成功結果要件なしのジョブneeds依存関係\n\n次の例のフローでは、ジョブ`job2`は`job1`が成功した後に実行されますが、`job3`は`always()`条件式を使用しています。そのため、`job3`は`job1`と`job2`が成功または失敗にかかわらず実行されます。`needs`セクションにより、ジョブは`job1` -\u003e `job2` -\u003e `job3`の順序で順次実行されます。\n\n```yaml\njobs:\n  job1:\n  job2:\n    needs: job1\n  job3:\n    if: ${{ always() }}\n    needs: [job1, job2]\n```\n\nSee actual sample.\n\n```yaml\n# .github/workflows/job-needs-always.yaml\n\nname: job needs always\n\non:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n  workflow_dispatch:\n\njobs:\n  A:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"a\"\n\n  B:\n    needs: [A]\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"b\"\n\n  # always run without A and B result\n  C:\n    needs: [A, B]\n    if: ${{ always() }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"c\"\n\n```\n\n### \\u30b8\\u30e7\\u30d6needs\\u3068\\u30b9\\u30ad\\u30c3\\u30d7\\u51e6\\u7406\\n\\n\\u6b21\\u306e\\u4f8b\\u306f\\u3001`needs`\\u30bb\\u30af\\u30b7\\u30e7\\u30f3\\u3067\\u30b8\\u30e7\\u30d6\\u30b9\\u30ad\\u30c3\\u30d7\\u3092\\u51e6\\u7406\\u3059\\u308b\\u65b9\\u6cd5\\u3092\\u793a\\u3057\\u3066\\u3044\\u307e\\u3059\\u3002\\u30b8\\u30e7\\u30d6`needs`\\u306f\\u30b9\\u30ad\\u30c3\\u30d7\\u51e6\\u7406\\u306b\\u4f7f\\u7528\\u3067\\u304d\\u307e\\u3059\\u3002\\u3057\\u304b\\u3057\\u3001\\u4f9d\\u5b58\\u30b8\\u30e7\\u30d6\\u3092\\u30b9\\u30ad\\u30c3\\u30d7\\u3059\\u308b\\u3068\\u3001\\u6b21\\u306e\\u30b8\\u30e7\\u30d6\\u306b\\u554f\\u984c\\u304c\\u767a\\u751f\\u3057\\u307e\\u3059\\u3002\\u6b21\\u306e\\u30ef\\u30fc\\u30af\\u30d5\\u30ed\\u30fc\\u306f\\u3001`C`\\u304c\\u547c\\u3073\\u51fa\\u3055\\u308c\\u305f\\u3068\\u304d\\u306b`D`\\u3092\\u5b9f\\u884c\\u3059\\u308b\\u3053\\u3068\\u304c\\u671f\\u5f85\\u3055\\u308c\\u3066\\u3044\\u307e\\u3059\\u3002\\u3057\\u304b\\u3057\\u3001`A`\\u3068`B`\\u3092\\u30b9\\u30ad\\u30c3\\u30d7\\u3059\\u308b\\u3068`D`\\u3082\\u30b9\\u30ad\\u30c3\\u30d7\\u3055\\u308c\\u307e\\u3059\\u3002\n\n```yaml\n# .github/workflows/job-needs-skip-handling-bad.yaml\n\nname: job needs skip handling (bad)\non:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n  workflow_dispatch:\n\njobs:\n  A:\n    if: ${{ false }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"a\"\n\n  B:\n    if: ${{ false }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"b\"\n\n  C:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"c\"\n\n  # D will always skip because A and B is skipped\n  D:\n    needs: [A, B, C]\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"d\"\n\n```\n\n\\u4e0a\\u8a18\\u306e\\u4f8b\\u3092\\u4fee\\u6b63\\u3057\\u3001`C`\\u304c\\u547c\\u3073\\u51fa\\u3055\\u308c\\u305f\\u3068\\u304d\\u306b`D`\\u304c\\u5b9f\\u884c\\u3055\\u308c\\u308b\\u3088\\u3046\\u306b\\u3059\\u308b\\u306b\\u306f\\u3001`D`\\u306b`if`\\u6761\\u4ef6\\u3092\\u8ffd\\u52a0\\u3059\\u308b\\u5fc5\\u8981\\u304c\\u3042\\u308a\\u307e\\u3059\\u3002\\u3053\\u308c\\u306f\\u3001\\u6761\\u4ef6\\u4ed8\\u304d\\u547c\\u3073\\u51fa\\u3057\\u304c\\u306a\\u3044\\u5834\\u5408\\u3082\\u51e6\\u7406\\u3059\\u308b\\u5fc5\\u8981\\u304c\\u3042\\u308a\\u307e\\u3059: `A`\\u3001`B`\\u3001`C`\\u304c\\u6210\\u529f\\u3057\\u305f\\u5834\\u5408\\u3001`D`\\u3092\\u5b9f\\u884c\\u3059\\u308b\\u5fc5\\u8981\\u304c\\u3042\\u308a\\u307e\\u3059\\u3002\n\n```yaml\n# .github/workflows/job-needs-skip-handling-ok.yaml\n\nname: job needs skip handling (ok)\non:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n  workflow_dispatch:\n    inputs:\n      only-c:\n        description: \"Run only Job C\"\n        required: false\n        default: false\n        type: boolean\n\njobs:\n  A:\n    if: ${{ !inputs.only-c }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"a\"\n\n  B:\n    if: ${{ !inputs.only-c }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"b\"\n\n  C:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"c\"\n\n  # D will run when \"C is success\" or \"all the jobs are success\".\n  D:\n    needs: [A, B, C]\n    if: ${{ inputs.only-c \u0026\u0026 needs.C.result == 'success' || success() }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"d\"\n\n```\n\n## ジョブ出力\n\nジョブ間で値を渡したい場合は、[ジョブ出力](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job-outputs)と[ジョブneeds](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idneeds)を使用できます。`jobs.\u003cjob_id\u003e.outputs`でジョブ出力を設定し、他のジョブは`needs.\u003cjob_id\u003e.outputs.\u003coutput_name\u003e`でそれを参照できます。\n\n同じジョブ内のステップ間で値を渡したい場合は、[ステップ出力](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#setting-an-output-parameter)を使用できます。`steps.\u003cstep_id\u003e.outputs`でステップ出力を設定し、他のステップは`steps.\u003cstep_id\u003e.outputs.\u003coutput_name\u003e`でそれを参照できます。\n\n次の例は、`a`ジョブでジョブ出力を設定し、`b`ジョブでそれを参照する方法を示しています。\n\n```yaml\n# .github/workflows/job-outputs.yaml\n\nname: job needs basic\n\non:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n  workflow_dispatch:\n\njobs:\n  a:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    outputs:\n      result: ${{ steps.a-step.outputs.result }}\n    steps:\n      - name: run a\n        id: a-step\n        run: echo \"result=a\" | tee -a \"$GITHUB_OUTPUT\"\n\n  b:\n    needs: [a]\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 1\n    steps:\n      - run: echo \"a=${{ needs.a.outputs.result }}\"\n\n```\n\n## 冗長制御\n\n\u003e [!WARNING]\n\u003e 冗長制御の代わりにワークフロー並行制御の使用を検討してください。\n\nPRを作成すると、`push`と`pull_request/synchronize`の2つのイベントが発生します。これは、重複するビルドが開始され、ビルド時間を無駄にすることを意味します。\nプライベートリポジトリを実行している場合、ビルド時間制限があるため、冗長ビルドは問題を引き起こす可能性があります。言い換えれば、リポジトリがPublicの場合はビルド時間の消費を心配する必要はありません。\n\n### 同じリポジトリでpull_requestトリガー時のpushを回避\n\nこの例では、`push`はデフォルトブランチの`main`でのみトリガーされます。これは、`pull_request` synchronizeイベントが発生したときにpushが実行されないことを意味します。\nこれはほとんどのユースケースに十分簡単です。\n\n```yaml\n# .github/workflows/push-and-pr-avoid-redundant.yaml\n\nname: push and pull_request avoid redundant\non:\n  # prevent push run on pull_request\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  my-job:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo push and pull_request trigger\n\n```\n\n### 冗長ビルドのキャンセル\n\n重複するワークフローをキャンセルし、CIを失敗としてマークします。\n\n```yaml\n# .github/workflows/cancel-redundantbuild.yaml\n\nname: cancel redundant build\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  cancel:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      # no check for main and tag\n      - uses: rokroskar/workflow-run-cleanup-action@ee1451b869ba1e381729b3d40489997021f0d562 # v0.3.3\n        if: ${{ !startsWith(github.ref, 'refs/tags/') \u0026\u0026 github.ref != 'refs/heads/main' }}\n        env:\n          GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n\n```\n\n## 前のジョブが成功したときに実行\n\nワークフロー内で順次ジョブ実行を実現するには、`needs:`を使用して現在のジョブが依存するジョブを指定します。\n\nこれにより、ジョブは前のジョブが**成功**した場合にのみ実行されます。\n\n```yaml\n# .github/workflows/sequential-run.yaml\n\nname: sequential jobs\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  build:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo \"$COMMIT_MESSAGES\"\n        env:\n          COMMIT_MESSAGES: ${{ toJson(github.event.commits.*.message) }}\n\n  publish:\n    needs: [build]\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo run when only build success\n\n```\n\n## 前のステップステータスが特定の場合に実行\n\n\u003e [job-status-check-functions /- Context and expression syntax for GitHub Actions /- GitHub Help](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions)\n\n特定のステータスに基づいてステップを実行するように設定する場合は、`if:`を使用します。\n\n```yaml\n# .github/workflows/status-step.yaml\n\nname: status step\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  job:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo \"$COMMIT_MESSAGES\"\n        env:\n          COMMIT_MESSAGES: ${{ toJson(github.event.commits.*.message) }}\n      - run: echo \"success() runs when none of the previous steps have failed or been canceled\"\n        if: ${{ success() }}\n      - run: echo \"always() runs even when cancelled. It runs only when a critical failure prevents the task.\"\n        if: ${{ always() }}\n      - run: echo \"cancelled() runs when workflow is cancelled.\"\n        if: ${{ cancelled() }}\n      - run: echo \"failure() runs when any previous step of a job fails.\"\n        if: ${{ failure() }}\n\n```\n\n\n## Matrix\n\nMatrixは、OS、バージョンなど、異なるパラメータで同じジョブを実行したい場合に便利です。Matrixは`jobs.\u003cjob_id\u003e.strategy.matrix`で定義します。次の例は、matrixの使用方法を示しています。\n\n- ジョブ失敗の処理方法を制御するには、`fail-fast: false`を使用して1つのmatrixジョブが失敗しても他のmatrixジョブを続行します。\n- Matrixはデフォルトでジョブを並列実行します。ただし、`max-parallel`で並列ジョブ数を制限することができます。\n- MatrixはOSやバージョンなどの複数の軸を定義できます。次の例では、6個のジョブが並列実行されます(3バージョン x 2 OS)。\n\n```yaml\n# .github/workflows/matrix.yaml\n\nname: matrix\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  parallel:\n    strategy:\n      # If set true, then if one matrix job fails, cancel others\n      fail-fast: false # default is true.\n      matrix:\n        version: [10, 12, 14]\n        runs-on: [ubuntu-24.04, ubuntu-latest]\n    permissions:\n      contents: read\n    runs-on: ${{ matrix.runs-on }}\n    timeout-minutes: 3\n    steps:\n      - name: Show runner info\n        run: |\n          echo \"runner.os: ${{ runner.os }}\"\n          echo \"matrix.runs-on: ${{ matrix.runs-on }}\"\n          echo \"matrix.version: ${{ matrix.version }}\"\n\n  serial:\n    strategy:\n      # run matrix jobs one by one = serial execution\n      max-parallel: 1\n      matrix:\n        version: [10, 12, 14]\n        runs-on: [ubuntu-24.04, ubuntu-latest]\n    permissions:\n      contents: read\n    runs-on: ${{ matrix.runs-on }}\n    timeout-minutes: 3\n    steps:\n      - name: Show runner info\n        run: |\n          echo \"runner.os: ${{ runner.os }}\"\n          echo \"matrix.runs-on: ${{ matrix.runs-on }}\"\n\n```\n\n`jobs.\u003cjob_id\u003e.strategy.matrix.include`でmatrixの組み合わせを拡張または追加できます。includeの値はオブジェクトのリストです。詳細は[リンク](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/run-job-variations#expanding-or-adding-matrix-configurations)を参照してください。\n\n次のワークフローを作成しましょう。\n\n```yaml\n# .github/workflows/matrix-include.yaml\n\nname: matrix include\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  include:\n    permissions:\n      contents: read\n    strategy:\n      matrix:\n        fruta: [manzana, pera]\n        animal: [gato, perro]\n        include:\n          - color: verde\n          - color: rosa\n            animal: gato\n          - fruta: manzana\n            forma: círculo\n          - fruta: plátano\n            forma: cuadrado\n          - fruta: plátano\n            animal: gato\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo \"${CONTEXT}\"\n        env:\n          CONTEXT: ${{ toJson(matrix) }}\n\n```\n\nFollowing matrix will run 6 jobs in total.\n\n```json\n// manzana, gato\n{\n  \"fruta\": \"manzana\",\n  \"animal\": \"gato\",\n  \"color\": \"rosa\",\n  \"forma\": \"círculo\"\n}\n// manzana, perro\n{\n  \"fruta\": \"manzana\",\n  \"animal\": \"perro\",\n  \"color\": \"verde\",\n  \"forma\": \"círculo\"\n}\n// pera, gato\n{\n  \"fruta\": \"pera\",\n  \"animal\": \"gato\",\n  \"color\": \"rosa\"\n}\n// pera, perro\n{\n  \"fruta\": \"pera\",\n  \"animal\": \"perro\",\n  \"color\": \"verde\"\n}\n// plátano, cuadrado\n{\n  \"fruta\": \"plátano\",\n  \"forma\": \"cuadrado\"\n}\n// plátano, gato\n{\n  \"fruta\": \"plátano\",\n  \"animal\": \"gato\"\n}\n```\n\n`jobs.\u003cjob_id\u003e.strategy.matrix.exclude`で特定のmatrixの組み合わせを除外できます。詳細は[リンク](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/run-job-variations#excluding-matrix-configurations)を参照してください。\n\n次のワークフローを作成しましょう。\n\n```yaml\n# .github/workflows/matrix-exclude.yaml\n\nname: matrix exclude\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  exclude:\n    permissions:\n      contents: read\n    strategy:\n      matrix:\n        fruta: [manzana, pera]\n        animal: [gato, perro]\n        exclude:\n          - fruta: manzana\n            animal: gato\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo \"${CONTEXT}\"\n        env:\n          CONTEXT: ${{ toJson(matrix) }}\n\n```\n\n次のmatrixは合計3個のジョブを実行します。`manzana`と`gato`の組み合わせが除外されているためです。\n\n```json\n// manzana, gato\n{\n  \"fruta\": \"manzana\",\n  \"animal\": \"gato\"\n}\n// pera, gato\n{\n  \"fruta\": \"pera\",\n  \"animal\": \"gato\"\n}\n// pera, perro\n{\n  \"fruta\": \"pera\",\n  \"animal\": \"perro\"\n}\n```\n\n### matrix内のシークレット参照\n\n`strategy.matrix`セクション内で`secret`コンテキストを参照できないため、matrixでシークレットキーを渡し、`secrets[matrix.SECRET_KEY]`でシークレットを参照します。\n\n設定でシークレットを設定してから、次のワークフローを実行しましょう。\n\n![GitHub Secrets sample](./images/secrets.png)\n\n```yaml\n# .github/workflows/matrix-secret.yaml\n\nname: matrix secret\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\nenv:\n  fruit: APPLES\n\njobs:\n  dereference:\n    strategy:\n      matrix:\n        org: [apples, bananas, carrots] #Array of org mnemonics to use below\n        include:\n          # includes a new variable for each org (this is effectively a switch statement)\n          - org: apples\n            secret: APPLES\n          - org: bananas\n            secret: BANANAS\n          - org: carrots\n            secret: CARROTS\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo \"org:${{ matrix.org }} secret:${SECRET}\"\n        env:\n          SECRET: ${{ secrets[matrix.secret] }} # zizmor: ignore[overprovisioned-secrets]\n      - run: echo \"env:${{ env.fruit }} secret:${SECRET}\"\n        env:\n          SECRET: ${{ secrets[env.fruit] }} # zizmor: ignore[overprovisioned-secrets]\n\n```\n\n### env内のMatrix参照\n\nstepsの前にジョブの`env:`セクションでmatrixを参照できます。\n\n```yaml\n# .github/workflows/matrix-envvar.yaml\n\nname: matrix envvar\non:\n  workflow_dispatch:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n\njobs:\n  echo:\n    strategy:\n      matrix:\n        org: [apples, bananas, carrots]\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    env:\n      ORG: ${{ matrix.org }}\n      # you can not use expression inside env:. do it on step.\n    steps:\n      - run: echo \"${ORG}\"\n      - run: echo \"${NEW_ORG}\"\n        env:\n          NEW_ORG: new-${{ env.ORG }}\n\n```\n\n## 手動実行のためのWorkflow dispatch\n\nワークフローを手動で実行したい場合は、`workflow_dispatch`イベントトリガーを使用します。\n\n- Web UIはActionsタブに`Run workflow`ボタンを提供します。\n- `gh` CLIでworkflow dispatchをトリガーできます。\n- GitHub APIを使用してworkflow dispatchをトリガーできます。\n\n### Workflow dispatchと値の渡し方\n\nworkflow dispatchを呼び出すときに値を渡すために[アクション入力](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs)を指定できます。\n\n入力は`on.workflow_dispatch.inputs`セクションで定義されます。次の例は、入力の定義とジョブステップでの参照方法を示しています。\n\n- `on.workflow_dispatch.inputs`: workflow dispatchを呼び出すときに渡す入力パラメータを定義します。\n  - 入力パラメータは`description`、`required`、`default`、`type`プロパティを持ちます。`type`として`string`、`boolean`、`choice`、`environment`を指定できます。\n- ジョブステップでは、`${{ inputs.\u003cinput_name\u003e }}`構文で入力値を参照できます。\n\nサポートされている入力タイプ:\n\n- `string`: デフォルトタイプ、Web UIはテキストボックスを提供します。\n- `number`: 数値、Web UIはテキストボックスを提供します。\n- `boolean`: `true`または`false`、Web UIはチェックボックスを提供します。\n- `choice`: 列挙オプション、Web UIは選択ボックスを提供します。`options`プロパティを定義する必要があります。\n- `environment`: GitHub Environmentsの列挙、Web UIは選択ボックスを提供します。\n\n```yaml\n# .github/workflows/workflowdispatch-inputs.yaml\n\nname: workflowdispatch inputs\non:\n    workflow_dispatch:\n        inputs:\n            branch:\n                description: \"branch name to clone\"\n                required: true\n                default: \"main\"\n                type: string\n            logLevel:\n                description: \"Log level\"\n                required: true\n                default: \"warning\"\n                type: choice\n                options:\n                    - debug\n                    - info\n                    - warning\n                    - error\n            dry-run:\n                description: \"Enable dry-run mode\"\n                required: false\n                type: boolean\n            number:\n                description: \"An optional number\"\n                required: false\n                default: 0\n                type: number\n            tags:\n                description: \"Test scenario tags\"\n                required: false\n\njobs:\n    printInputs:\n        permissions:\n            contents: read\n        runs-on: ubuntu-24.04\n        timeout-minutes: 3\n        env:\n            BRANCH: ${{ inputs.branch }}\n            LOGLEVEL: ${{ inputs.logLevel }}\n            TAGS: ${{ inputs.tags }}\n            DRY_RUN: ${{ inputs.dry-run }}\n        steps:\n            - name: Show Environment Variables\n              run: env\n            - run: echo \"BRANCH=${{ env.BRANCH }}, LOGLEVEL=${{ env.LOGLEVEL }}, TAGS=${{ env.TAGS }}, DRY_RUN=${{ env.DRY_RUN }}\"\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  ref: ${{ inputs.branch }}\n                  persist-credentials: false\n            - name: Show Input value\n              run: |\n                  echo \"Log level: ${LOG_LEVEL}\"\n                  echo \"Number: ${NUMBER}\"\n              env:\n                  LOG_LEVEL: ${{ inputs.logLevel }}\n                  NUMBER: ${{ inputs.number }}\n            - name: INPUT_ is not generated automatcally\n              run: |\n                  echo \"INPUT_BRANCH: ${INPUT_BRANCH}\"\n                  echo \"TEST_number: ${TEST_numer}\"\n\n```\n\n# Basic - Commit, Branch and Tag handling\n\n## リリースを作成する\n\n`gh` CLIツールを使用してGitHubリリースを作成できます。いくつかのアクションがありますが、リリース作成は十分にシンプルなので、`gh` CLIツールを直接使用することをお勧めします。\n\n主要なコマンドは`gh release create`と`gh release upload`です。最初にドラフトリリースを作成し、その後リリースにファイルをアップロードすることをお勧めします。すべての準備が整ったら、ドラフトリリースを公開済みに変更します。\n\n```sh\n# create draft release with auto generated notes\ngh release create \u003cTAG\u003e --draft --verify-tag --title \"Ver.\u003cTAG\u003e\" --generate-notes\n\n# upload files to release\ngh release upload \u003cTAG\u003e file-1.txt file-2.txt\n```\n\n次の例は、`v1.0.0`のようなタグをプッシュしたときにトリガーされます。ワークフローは自動生成されたノートでドラフトリリースを作成し、ファイルをアップロードします。\n\n```yaml\n# .github/workflows/create-release-simple.yaml\n\nname: create release simple\nconcurrency: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}\non:\n  push:\n    tags:\n      - \"v[0-9]+.[0-9]+.[0-9]+*\"\n\njobs:\n  create-release:\n    permissions:\n      contents: write\n    runs-on: ubuntu-24.04\n    timeout-minutes: 10\n    steps:\n      - name: Setup tag\n        id: tag\n        run: echo \"value=${{ env.TAG_VALUE }}\" | tee -a \"$GITHUB_OUTPUT\"\n        env:\n          TAG_VALUE: ${{ github.ref_name }}\n      # create dummy files\n      - run: echo \"hoge\" \u003e \"hoge.${{ steps.tag.outputs.value }}.txt\"\n      - run: echo \"fuga\" \u003e \"fuga.${{ steps.tag.outputs.value }}.txt\"\n      # create draft release\n      - name: Create Release\n        run: gh release create ${{ steps.tag.outputs.value }} --draft --verify-tag --title \"Ver.${{ steps.tag.outputs.value }}\" --generate-notes\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          GH_REPO: ${{ github.repository }}\n      # upload files to release\n      - name: Upload file to release\n        run: gh release upload ${{ steps.tag.outputs.value }} hoge.${{ steps.tag.outputs.value }}.txt fuga.${{ steps.tag.outputs.value }}.txt\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          GH_REPO: ${{ github.repository }}\n\n```\n\n## ファイル変更を検出する\n\nGitHub Actionsのpushまたはpull_requestイベントで、どのファイルが変更されたかを検出できます。これは、`path-filter`を使用したいが、さらにファイル処理が必要な場合に便利です。次のアクションが利用可能で、同じように使用できます。\n\n`dorny/paths-filter`は現在も活発に開発されています。ただし、その出力は非常に動的で、actionlintのような静的リンターでは扱いにくいです。\n\n```yaml\n# .github/workflows/file-change-detect-dorny.yaml\n\nname: file change detect dorny\non:\n    pull_request:\n        branches: [\"main\"]\n    push:\n        branches: [\"main\"]\n\njobs:\n    changed-files:\n        permissions:\n            contents: read\n        runs-on: ubuntu-24.04\n        timeout-minutes: 3\n        steps:\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  persist-credentials: false\n            # see: https://github.com/dorny/paths-filter/blob/master/README.md\n            - id: changed-files\n              uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2\n              with:\n                  base: ${{ github.event_name == 'push' \u0026\u0026 github.ref || '' }}\n                  list-files: csv # default 'none'. Disables listing of matching files.\n                  filters: |\n                      foo:\n                        - '**'\n            - name: Is any change happen on some filters?\n              run: echo \"${{ steps.changed-files.outputs.changes }}\"\n            - name: Is change happen on foo filter?\n              run: echo \"${{ steps.changed-files.outputs.foo }}\"\n            - name: Changed file list for foo filter\n              run: echo \"${{ steps.changed-files.outputs.foo_files }}\"\n            - name: Is foo filter changed files include .github/workflows?\n              run: echo \"${{ contains(steps.changed-files.outputs.foo_files, '.github/workflows')}}\"\n            - name: Is foo filter changed files include .github/dummy?\n              run: echo \"${{ contains(steps.changed-files.outputs.foo_files, '.github/dummy')}}\"\n            # space separated\n            - id: changed-files2\n              uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2\n              if: ${{ github.event.pull_request.changed_files \u003c 100 }} # when changed files less than 100\n              with:\n                  base: ${{ github.event_name == 'push' \u0026\u0026 github.ref || '' }}\n                  list-files: shell\n                  filters: |\n                      foo:\n                        - '**'\n            - name: List all changed files\n              env:\n                  CHANGED_FILES: ${{ steps.changed-files2.outputs.foo_files }}\n              run: |\n                  for file in ${CHANGED_FILES}; do\n                    echo \"$file was changed\"\n                  done\n            # json separated\n            - id: changed-files3\n              uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2\n              with:\n                  base: ${{ github.event_name == 'push' \u0026\u0026 github.ref || '' }}\n                  list-files: json\n                  filters: |\n                      foo:\n                        - '**'\n            - name: Changed file list for foo filter\n              run: echo \"${{ steps.changed-files3.outputs.foo_files }}\"\n\n```\n\n`trilom/file-changes-action`は開発が停止したため、使用を中止しました。\n\n```yaml\n# .github/workflows/file-change-detect-dorny.yaml\n\nname: file change detect dorny\non:\n    pull_request:\n        branches: [\"main\"]\n    push:\n        branches: [\"main\"]\n\njobs:\n    changed-files:\n        permissions:\n            contents: read\n        runs-on: ubuntu-24.04\n        timeout-minutes: 3\n        steps:\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  persist-credentials: false\n            # see: https://github.com/dorny/paths-filter/blob/master/README.md\n            - id: changed-files\n              uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2\n              with:\n                  base: ${{ github.event_name == 'push' \u0026\u0026 github.ref || '' }}\n                  list-files: csv # default 'none'. Disables listing of matching files.\n                  filters: |\n                      foo:\n                        - '**'\n            - name: Is any change happen on some filters?\n              run: echo \"${{ steps.changed-files.outputs.changes }}\"\n            - name: Is change happen on foo filter?\n              run: echo \"${{ steps.changed-files.outputs.foo }}\"\n            - name: Changed file list for foo filter\n              run: echo \"${{ steps.changed-files.outputs.foo_files }}\"\n            - name: Is foo filter changed files include .github/workflows?\n              run: echo \"${{ contains(steps.changed-files.outputs.foo_files, '.github/workflows')}}\"\n            - name: Is foo filter changed files include .github/dummy?\n              run: echo \"${{ contains(steps.changed-files.outputs.foo_files, '.github/dummy')}}\"\n            # space separated\n            - id: changed-files2\n              uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2\n              if: ${{ github.event.pull_request.changed_files \u003c 100 }} # when changed files less than 100\n              with:\n                  base: ${{ github.event_name == 'push' \u0026\u0026 github.ref || '' }}\n                  list-files: shell\n                  filters: |\n                      foo:\n                        - '**'\n            - name: List all changed files\n              env:\n                  CHANGED_FILES: ${{ steps.changed-files2.outputs.foo_files }}\n              run: |\n                  for file in ${CHANGED_FILES}; do\n                    echo \"$file was changed\"\n                  done\n            # json separated\n            - id: changed-files3\n              uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2\n              with:\n                  base: ${{ github.event_name == 'push' \u0026\u0026 github.ref || '' }}\n                  list-files: json\n                  filters: |\n                      foo:\n                        - '**'\n            - name: Changed file list for foo filter\n              run: echo \"${{ steps.changed-files3.outputs.foo_files }}\"\n\n```\n\n## 非デフォルトブランチでのスケジュールジョブ\n\nスケジュールされたジョブは`デフォルトブランチの最後のコミット`を使用します。\n\n\u003e 参照: [Events that trigger workflows /- GitHub Help](https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)\n\nスケジュールされたワークフローは、ワークフロー変更を適用するためにデフォルトブランチにマージされている必要があります。\n\n非デフォルトブランチでcheckoutを実行したい場合は、ブランチ情報を渡します。\nブランチに`refs/heads/`を前置することを忘れないでください。\n\n- 良い: refs/heads/some-branch\n- 悪い: some-branch\n\n```yaml\n# .github/workflows/schedule-job.yaml\n\nname: schedule job\non:\n    schedule:\n        - cron: \"0 0 * * 1\"\n\njobs:\n    job:\n        permissions:\n            contents: read\n        runs-on: ubuntu-24.04\n        timeout-minutes: 3\n        steps:\n            - name: Dump GitHub context\n              run: echo \"$CONTEXT\"\n              env:\n                  CONTEXT: ${{ toJson(github) }}\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  ref: refs/heads/some-branch\n                  persist-credentials: false\n\n```\n\nGitHub Actionsを通じてリリースを作成し、アセットをアップロードできます。\n複数のアセットアップロードは、各アセットに対して`actions/upload-release-asset`を実行することでサポートされます。\n\n```yaml\n# .github/workflows/create-release.yaml\n\nname: create release\nconcurrency: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}\non:\n    # auto clean up\n    push:\n        tags:\n            - \"[0-9]+.[0-9]+.[0-9]+*\"\n    # auto clean up\n    pull_request:\n        branches: [\"main\"]\n    workflow_dispatch:\n        inputs:\n            tag:\n                description: \"tag: git tag you want create. (1.0.0)\"\n                required: true\n            delete-release:\n                description: \"delete-release: delete release after creation. (true/false)\"\n                required: false\n                default: false\n                type: boolean\n\nenv:\n    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    GH_REPO: ${{ github.repository }}\n\njobs:\n    create-release:\n        if: ${{ github.actor != 'dependabot[bot]' }}\n        permissions:\n            contents: write\n        runs-on: ubuntu-24.04\n        timeout-minutes: 10\n        steps:\n            - name: Setup tag\n              id: tag\n              run: echo \"value=${{ env.TAG_VALUE || (github.event_name == 'pull_request' \u0026\u0026 '0.1.0-test' || env.GITHUB_REF_NAME) }}\" | tee -a \"$GITHUB_OUTPUT\"\n              env:\n                  TAG_VALUE: ${{ inputs.tag }}\n                  GITHUB_REF_NAME: ${{ github.ref_name }}\n            # Create Tag\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  persist-credentials: false\n            # Use the appropriate tag output from the condition steps\n            - name: set git remote\n              env:\n                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n              run: |\n                  git remote set-url origin \"https://github-actions:${GITHUB_TOKEN}@github.com/${{ github.repository }}\"\n                  git config user.name  \"github-actions[bot]\"\n                  git config user.email \"41898282+github-actions[bot]@users.noreply.github.com\"\n            - name: Create Tag and push if not exists\n              env:\n                  TAG_VALUE: ${{ steps.tag.outputs.value  }}\n              run: |\n                  if ! git ls-remote --tags | grep \"$TAG_VALUE\"; then\n                    git tag \"$TAG_VALUE\"\n                    git push origin \"$TAG_VALUE\"\n                    git ls-remote --tags\n                  fi\n            # set release tag(*.*.*) to version string\n            - run: echo \"foo\" \u003e \"foo.${{ steps.tag.outputs.value }}.txt\"\n            - run: echo \"hoge\" \u003e \"hoge.${{ steps.tag.outputs.value }}.txt\"\n            - run: echo \"fuga\" \u003e \"fuga.${{ steps.tag.outputs.value }}.txt\"\n            - run: ls -l\n            # Create Releases\n            - name: Create Release\n              run: gh release create ${{ steps.tag.outputs.value }} --draft --verify-tag --title \"Ver.${{ steps.tag.outputs.value }}\" --generate-notes\n            - name: Upload file to release\n              run: gh release upload ${{ steps.tag.outputs.value }} hoge.${{ steps.tag.outputs.value }}.txt fuga.${{ steps.tag.outputs.value }}.txt\n            - name: Upload additional file to release\n              run: gh release upload ${{ steps.tag.outputs.value }} foo.${{ steps.tag.outputs.value }}.txt\n            # Clean up\n            - name: Clean up (Wait 60s and delete Release)\n              run: |\n                  if gh release list | grep Draft | grep ${{ steps.tag.outputs.value }}; then\n                    sleep 60\n                    gh release delete ${{ steps.tag.outputs.value }} --yes --cleanup-tag\n                  fi\n              if: ${{ failure() || inputs.delete-release || (github.event_name == 'pull_request' || github.event_name == 'push') }}\n\n```\n\n## ブランチプッシュのみをトリガーし、タグプッシュではスキップ\n\nブランチへのプッシュ時のみジョブを実行し、タグプッシュでは実行したくない場合。`on.push`から`tags`セクションを削除するか、否定パターン`!*`を設定します。\n\n```yaml\n# .github/workflows/branch-push-only.yaml\n\nname: branch push only\non:\n  push:\n    branches: [\"main\"]\n    tags:\n      - \"!*\" # not a tag push\n\njobs:\n  aws:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo not run on tag\n\n```\n\n## コミットメッセージでトリガーする\n\n```yaml\n# .github/workflows/trigger-ci.yaml\n\nname: trigger ci commit\non:\n  push:\n    branches: [\"main\"]\n\njobs:\n  job:\n    if: ${{ contains(toJSON(github.event.commits.*.message), '[build]') }}\n    runs-on: ubuntu-24.04\n    permissions:\n      contents: read\n    timeout-minutes: 3\n    steps:\n      - run: echo \"$COMMIT_MESSAGES\"\n        env:\n          COMMIT_MESSAGES: ${{ toJson(github.event.commits.*.message) }}\n\n```\n\n## タグプッシュのみをトリガーし、ブランチプッシュではスキップ\n\nタグへのプッシュ時のみジョブを実行し、ブランチプッシュでは実行したくない場合。\n\n```yaml\n# .github/workflows/tag-push-only.yaml\n\nname: tag push only\non:\n  push:\n    tags:\n      - \"**\" # only tag\n\njobs:\n  job:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo not run on branch push\n\n```\n\n## 特定のタグパターンでトリガーする\n\n`on.push.tags`でパターンを使用できますが、`step.if`では使用できません。\nこのパターンは次のものにマッチします。\n\n- 0.0.1\n- 1.0.0+preview\n- 0.0.3-20200421-preview+abcd123408534\n\n次のものにはマッチしません。\n\n- v0.0.1\n- release\n\n```yaml\n# .github/workflows/tag-push-only-pattern.yaml\n\nname: tag push only pattern\non:\n  push:\n    tags:\n      - \"[0-9]+.[0-9]+.[0-9]+*\" # only tag with pattern match\n\njobs:\n  job:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo not run on branch push\n\n```\n\n# Basic - Issue and Pull Request handling\n\n## プルリクエストのラベルを検出する\n\n`pull_request`イベントにはラベルが含まれており、それらを使用してステップの実行をフィルターできます。\n`${{ contains(github.event.pull_request.labels.*.name, 'hoge') }}`は、ラベルに`hoge`が含まれていれば`true`を返します。\n\n```yaml\n# .github/workflows/pr-label-get.yaml\n\nname: pr label get\non:\n  pull_request:\n    types:\n      - labeled\n      - opened\n      - reopened\n      - synchronize\n\njobs:\n  changes:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    env:\n      IS_HOGE: \"false\"\n    steps:\n      - run: echo \"${GITHUB_LABELS}\"\n        env:\n          GITHUB_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}\n      - if: ${{ env.IS_HOGE == 'true' }}\n        run: echo \"run!\"\n        env:\n          IS_HOGE: ${{ contains(github.event.pull_request.labels.*.name, 'hoge') }}\n\n```\n\n## プルリクエストのタイトルでCIをスキップする\n\nデフォルトの`pull_request`イベントは、アクティビティタイプが`opened`、`synchronize`、または`reopened`のときにトリガーされます。\n\n\u003e [Events that trigger workflows /- GitHub Help](https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request)\n\n```yaml\n# .github/workflows/skip-ci-pr-title.yaml\n\nname: skip ci pr title\non:\n  pull_request:\n\njobs:\n  skip:\n    if: ${{ !(contains(github.event.pull_request.title, '[skip ci]') || contains(github.event.pull_request.title, '[ci skip]')) }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo \"$GITHUB_CONTEXT\"\n        env:\n          GITHUB_CONTEXT: ${{ toJson(github) }}\n      - run: echo \"$TITLE\"\n        env:\n          TITLE: ${{ toJson(github.event.pull_request.title) }}\n  build:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    needs: skip\n    steps:\n      - run: echo run when not skipped\n\n```\n\n## フォークリポジトリからのPRをスキップ\n\nデフォルトでは、`pull_request`イベントはフォークリポジトリからもトリガーされます。しかし、フォークPRは`secrets`を読み取ることができず、PRチェックが失敗する可能性があります。\nフォークからのジョブをスキップし、自分のPRまたはpushでのみ実行するには、`if`条件を使用します。\n\n```yaml\n# .github/workflows/skip-pr-from-fork.yaml\n\nname: skip pr from fork\non:\n  push:\n    branches: [\"main\"]\n  pull_request:\n    branches: [\"main\"]\n    types:\n      - opened\n      - synchronize\n\njobs:\n  build:\n    # push \u0026 my repo will trigger\n    # pull_request on my repo will trigger\n    if: ${{ (github.event_name == 'push' \u0026\u0026 github.repository_owner == 'guitarrapc') || startsWith(github.event.pull_request.head.label, 'guitarrapc:') }}\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - run: echo build\n\n```\n\n## ドラフトPR時にジョブをスキップ\n\nプルリクエストがドラフトの場合、ジョブとステップをスキップできます。\n残念ながら、GitHub Webhook v3イベントはドラフトPRタイプを提供しませんが、PRがドラフトの場合、`event.pull_request.draft`が`true`を返します。\n\n```yaml\n# .github/workflows/skip-draft-pr.yaml\n\nname: skip draft pr\non:\n    pull_request: null\n    push:\n        branches: [\"main\"]\n\njobs:\n    job:\n        if: ${{ ! github.event.pull_request.draft }}\n        permissions:\n            contents: read\n        runs-on: ubuntu-24.04\n        timeout-minutes: 3\n        steps:\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  persist-credentials: false\n\n```\n\nPRラベルで動作を制御できます。\n\n```yaml\n# .github/workflows/skip-draft-but-label-pr.yaml\n\nname: skip draft pr but label\non:\n    pull_request:\n        types:\n            - synchronize\n            - opened\n            - reopened\n            - ready_for_review\n\njobs:\n    build:\n        # RUN WHEN\n        # 1. PR has label 'draft_but_ci'\n        # 2. Not draft, `push` and `non-draft pr`.\n        if: ${{ (contains(github.event.pull_request.labels.*.name, 'draft_but_ci')) || !(github.event.pull_request.draft) }}\n        permissions:\n            contents: read\n        runs-on: ubuntu-24.04\n        timeout-minutes: 3\n        steps:\n            - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n              with:\n                  persist-credentials: false\n\n```\n\n---\n\n# 高度な機能\n\n高度なテクニック。\n\n## Dependabotによる自動Actionsバージョン更新\n\n[Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions)を使用してGitHub Actionsのバージョンを自動的に更新できます。Dependabotはアクションを最新の状態に保つためのプルリクエストを作成し、手動または自動でマージできます。\n\nGitHub Actions更新のためにDependabotを有効にするには、リポジトリに`.github/dependabot.yml`を追加します。\n\n次はサンプルdependabot.yamlファイルです。\n\n- GitHub Actions/NuGetを毎週更新しますが、パッチバージョン更新は無視します。\n- また、14日間のクールダウン期間を設定しています。これは、前回の更新PRが作成されてから14日以内に同じ依存関係に対してDependabotが新しいPRを作成しないことを意味します。これは、一時的な依存関係の脆弱性によるセキュリティリスクを軽減するのに役立ちます。\n\n```yaml\n# .github/dependabot.yaml\n\n# ref: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot\nversion: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\" # Check for updates to GitHub Actions every week\n    cooldown:\n      default-days: 14\n    ignore:\n      # I just want update action when major/minor version is updated. patch updates are too noisy.\n      - dependency-name: \"*\"\n        update-types:\n          - version-update:semver-patch\n  - package-ecosystem: \"nuget\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n    cooldown:\n      default-days: 14\n    ignore:\n      # I just want update action when major/minor version is updated. patch updates are too noisy.\n      - dependency-name: \"*\"\n        update-types:\n          - version-update:semver-patch\n\n```\n\n**dependabot.yamlのカスタマイズ**\n\n[dependabot.yamlファイルの設定オプション](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file)がいくつかあります。\n\n**dependabotアクションでシークレットにアクセスする**\n\nDependabotイベントがワークフローをトリガーすると、ワークフローで利用できるシークレットはDependabotシークレットのみです。GitHub Actionsシークレットは利用できません。\n\n\u003e ref: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#accessing-secrets\n\nそのため、Dependabotトリガーのワークフローではシークレットを使用しないことをお勧めします。シークレットが必要な場合は、Dependabotシークレットに同じシークレット名を追加してください。\n\n## Build Artifacts\n\nGitHub Actionsの[actions/upload-artifact](https://github.com/actions/upload-artifact)と[actions/download-artifact](https://github.com/actions/download-artifact)は、ジョブ間での成果物の処理を提供します。GitHub Actionsで成果物をアップロードおよびダウンロードできます。\n\n**file**\n\n```yaml\n# .github/workflows/artifacts-file.yaml\n\nname: artifacts (file)\non:\n  workflow_dispatch:\n  pull_request:\n    branches: [main]\n  push:\n    branches: [main]\n\njobs:\n  # single file\n  upload-file:\n    permissions:\n      contents: read\n    runs-on: ubuntu-24.04\n    timeout-minutes: 3\n    steps:\n      - name: output\n        run: |\n          echo \"hoge\" \u003e ./hoge.txt\n      - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0\n        with:\n          name: hoge.txt\n          path: ./hoge.txt\n          retention-days: 1\n\n  download-file:\n    needs:","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguitarrapc%2Fgithubactions-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguitarrapc%2Fgithubactions-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguitarrapc%2Fgithubactions-lab/lists"}