116k views
5 votes
Every job in a GitHub workflow always executes if the job preceding it completed successfully. Select yes if the statement is true. Otherwise, select no.

a) Yes
b) No

User Idok
by
8.2k points

2 Answers

5 votes

Final answer:

b) No, The statement is not entirely accurate because jobs run concurrently by default in GitHub workflows unless dependencies are defined using the 'needs' keyword.

Step-by-step explanation:

The statement that 'Every job in a GitHub workflow always executes if the job preceding it is completed successfully' is not entirely accurate. By default, jobs in a GitHub workflow run independently and concurrently, unless they are explicitly defined to depend on the completion of other jobs. However, you can use the 'needs' keyword within a job to specify that it should only run after certain other jobs have been completed successfully. This forms a dependency relationship between the jobs. If the dependent jobs fail, the current job won't execute. So, in workflows where the 'needs' keyword is not utilized, jobs do not wait for the previous ones to succeed and can run concurrently. Therefore, without additional context, the answer would be b) No, not every job is guaranteed to execute only after the predecessor has completed successfully.

User Obsivus
by
7.4k points
0 votes

Final answer:

Yes, the statement is true. Each job in a GitHub workflow executes if the job preceding it completed successfully.

Step-by-step explanation:

Yes, the statement is true. In a GitHub workflow, each job is listed in sequence and the subsequent job will only run if the preceding job completed successfully. This ensures that the workflow progresses smoothly and each job builds upon the success of the previous one.

For example, if a job in the workflow fails due to an error, the subsequent jobs will not be triggered, preventing the execution of potentially faulty or incomplete tasks.


SEO Keywords: GitHub workflow, job sequence, completed successfully, subsequent jobs, fail, error.

User PeterN
by
6.9k points