Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment in Creating dependent jobs section is vague and confusing #764

Closed
gsrohde opened this issue Oct 23, 2020 · 8 comments
Closed

Comment in Creating dependent jobs section is vague and confusing #764

gsrohde opened this issue Oct 23, 2020 · 8 comments
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team ecosystem This issue or pull request should be reviewed by the Docs Ecosystem team help wanted Anyone is welcome to open a pull request to fix this issue

Comments

@gsrohde
Copy link
Contributor

gsrohde commented Oct 23, 2020

What article on docs.github.com is affected?

https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#creating-dependent-jobs and/or https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds

What part(s) of the article would you like to see updated?

In https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#creating-dependent-jobs, the possibility of constraining jobs to run sequentially without the failure of earlier jobs in the sequence preventing the later jobs from running: If one of the jobs fails, all dependent jobs are skipped; however, if you need the jobs to continue, you can define this using the if conditional statement.

I had expected, thus, to see an example of how to do this, either directly here or in one of the two linked-to articles (either https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif or https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds).

It is not clear what sort of "if" statement is called for, nor whether it should supplement or replace the "needs" directive. The https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds article reiterates the possibility of constraining jobs to run in sequence without failing jobs preventing later jobs from running: If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue. This at least suggests that the "if" statement supplements the "needs" directive, but again, there is no example given of how to do this.

Since the Creating dependent jobs article occurs in the Learn GitHub Actions section of the documentation, it would probably be better to just omit the comment about allowing dependent jobs to run when their precursors fail, or at least to provide or link to an example the clarifies how to set this up.

Additional information

Content Plan

Linked here

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Oct 23, 2020
@janiceilene
Copy link
Contributor

Thanks so much for opening an issue @gsrohde! I'll get this triaged for review.

@janiceilene janiceilene added actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team ecosystem This issue or pull request should be reviewed by the Docs Ecosystem team and removed triage Do not begin working on this issue until triaged by the team labels Oct 23, 2020
@skedwards88
Copy link
Contributor

skedwards88 commented Dec 3, 2020

Thanks for pointing this out @gsrohde !

Here is an example of a job continuing based on a conditional even though it needs a job that failed:

name: need-fail-continue

on: [push, workflow_dispatch]

jobs:
  job1:
    runs-on: ubuntu-latest
    steps: 
      - run: exit 1 # This will cause job1 to fail
  
  job2:
    needs: [job1]
    if: ${{ always() }} # This makes job2 run even if job1 fails
    runs-on: ubuntu-latest
    steps: 
      - run: echo '...'
  

I agree with your assessment in the OP of where this example should be added. You or anyone is welcome to open a PR to address this issue!

@skedwards88 skedwards88 added the help wanted Anyone is welcome to open a pull request to fix this issue label Dec 3, 2020
@nazarmaddin

This comment has been minimized.

@tonyhallett
Copy link
Contributor

It should also be made clear, with examples, that the (Job status check functions)[https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions] apply to jobs as well as steps.

@janiceilene janiceilene added the needs content strategy Wait to open a PR until there's an approved content strategy in the issue label Jun 18, 2021
@ramyaparimi ramyaparimi removed the needs content strategy Wait to open a PR until there's an approved content strategy in the issue label Sep 29, 2021
@github-actions github-actions bot added the stale There is no recent activity on this issue or pull request label Aug 14, 2023
@The1onlyit
Copy link

A job should be fully explained I don't know what to figure out how to get it all done and will be trying new things in the internet to get it done 👍

@cmwilson21 cmwilson21 removed the stale There is no recent activity on this issue or pull request label Aug 15, 2023
@felicitymay
Copy link
Contributor

As far as I can tell, this issue has been fixed by the many updates to the Actions docs since this was originally raised.

@KINGTV1
Copy link

KINGTV1 commented Jan 26, 2025

#764

@KINGTV1
Copy link

KINGTV1 commented Jan 26, 2025


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team ecosystem This issue or pull request should be reviewed by the Docs Ecosystem team help wanted Anyone is welcome to open a pull request to fix this issue
Projects
None yet
Development

No branches or pull requests

14 participants