ノート: GitHubホストランナーは、現在GitHub Enterprise Serverでサポートされていません。 GitHubパブリックロードマップで、計画されている将来のサポートに関する詳しい情� �を見ることができます。
概要
A workflow run is made up of one or more jobs, which run in parallel by default. ジョブを逐次的に実行するには、jobs.<job_id>.needsキーワードを使用して他のジョブに対する依存関係を定義します。
それぞれのジョブは、runs-onで指定されたランナー環境で実行されます。
ワークフローの利用限度内であれば、実行するジョブ数に限度はありません。 For more information, see "Usage limits and billing" for GitHub-hosted runners and "About self-hosted runners" for self-hosted runner usage limits.
If you need to find the unique identifier of a job running in a workflow run, you can use the GitHub Enterprise Server API. 詳しい情� �については、「ワークフロージョブ」を参照してく� さい。
Setting an ID for a job
Use jobs.<job_id> to give your job a unique identifier. job_idキーは文字列型で、その値はジョブの設定データのマップとなるものです。 <job_id>は、jobsオブジェクトごとに一意の文字列に置き換える必要があります。 <job_id>は、英字または_で始める必要があり、英数字と-、_しか使用できません。
Example: Creating jobs
In this example, two jobs have been created, and their job_id values are my_first_job and my_second_job.
jobs: my_first_job: name: My first job my_second_job: name: My second job Setting a name for a job
Use jobs.<job_id>.name to set a name for the job, which is displayed in the GitHub UI.
Defining prerequisite jobs
Use jobs.<job_id>.needs to identify any jobs that must complete successfully before this job will run. 文字列型または文字列の配列です。 1つのジョブが失敗した� �合、失敗したジョブを続行するような条件式を使用していない限り、そのジョブを必要としている他のジョブはすべてスキップされます。 If a run contains a series of jobs that need each other, a failure applies to all jobs in the dependency chain from the point of failure onwards.
Example: Requiring successful dependent jobs
jobs: job1: job2: needs: job1 job3: needs: [job1, job2] この例では、job1が正常に完了してからjob2が始まり、job3はjob1とjob2が完了するまで待機します。
つまり、この例のジョブは逐次実行されるということです。
job1job2job3
Example: Not requiring successful dependent jobs
jobs: job1: job2: needs: job1 job3: if: ${{ always() }} needs: [job1, job2] この例では、job3は条件式のalways() を使っているので、job1とjob2が成功したかどうかにかかわらず、それらのジョブが完了したら常に実行されます。 For more information, see "Expressions."