Skip to content

Add needs: syntax example using always() condition #1307

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

Merged
merged 6 commits into from
Dec 14, 2020

Conversation

remyleone
Copy link
Contributor

@remyleone remyleone commented Nov 13, 2020

Why:

It was confusing for me to understand how the different dependencies between jobs are working. Adding an example about conditional execution of jobs would have helped me understand more quickly how to solve a problem I had using GitHub action.

What's being changed:

I've added an example about how to mix conditional and dependencies between jobs to ensure that a job always gets executed regardless of the results of jobs it depends on.
This is particularly useful when you have a "cleanup/sweeper" kind of job that you want to execute regardless or whether or not previous jobs worked.

Check off the following:

@welcome
Copy link

welcome bot commented Nov 13, 2020

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

Copy link
Contributor

@SMAKSS SMAKSS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there, thanks for the PR, I guess, if you seeking any change or question about anything in the docs, you can use discussion or create a new issue instead to communicate about it.

@remyleone
Copy link
Contributor Author

I can update the PR if I get confirmation that using

jobs:
  job1:
  job2:
    needs: job1
  job3:
    if: always()
    needs: [job1, job2]

is the canonical way to run job3 after job1 and job2 and whether or not job1 and job2 are successful or not

@hixio-mh

This comment has been minimized.

@janiceilene
Copy link
Contributor

Thanks for opening a PR 👍 Please fill out the pull request template in the top comment in this pull request, then we'll get this up for review!

@remyleone
Copy link
Contributor Author

@janiceilene done :)

@janiceilene
Copy link
Contributor

Thanks so much @remyleone! 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 labels Nov 17, 2020
@github-actions
Copy link
Contributor

This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.

@github-actions github-actions bot added the stale There is no recent activity on this issue or pull request label Nov 25, 2020
@janiceilene janiceilene removed the stale There is no recent activity on this issue or pull request label Nov 30, 2020
@janiceilene
Copy link
Contributor

@remyleone Thanks for your patience! Our small team is working our way through reviewing all of the amazing contributions ✨

@shati-patel
Copy link
Contributor

(Just for information: I updated this PR from main to fix a merge conflict that came from #1389. I'll let someone from the Ecosystem docs team take a look at the actual changes, since they're more familiar with these topics!)

@github-actions
Copy link
Contributor

This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.

@github-actions github-actions bot added the stale There is no recent activity on this issue or pull request label Dec 10, 2020
@janiceilene janiceilene removed the stale There is no recent activity on this issue or pull request label Dec 10, 2020
@lucascosti lucascosti self-assigned this Dec 14, 2020
@lucascosti
Copy link
Contributor

Hi @remyleone, thanks a lot for this suggestion! 🙇‍♂️ Another example for this would definitely be helpful!

I've made some edits to your PR to fix failing tests as well as make it more consistent with our style and other examples.

Because I've made some significant changes myself, I'll get another writer on the team to review this before we merge it.

Copy link
Contributor

@martin389 martin389 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lucascosti! Added some non-blocking personal preference suggestions.

@@ -270,6 +270,20 @@ The jobs in this example run sequentially:
2. `job2`
3. `job3`

#### Example not requiring dependent jobs to be successful
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll raise a docs issue for all the titles in this guide, so that we can move them to an "Example: verb" convention

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #2063 👍

@lucascosti lucascosti changed the title Update workflow-syntax-for-github-actions.md Add needs: syntax example using always() condition Dec 14, 2020
@lucascosti lucascosti merged commit cecda2a into github:main Dec 14, 2020
@github-actions
Copy link
Contributor

Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours.

@remyleone remyleone deleted the patch-1 branch December 14, 2020 15:35
jnidzwetzki pushed a commit to jnidzwetzki/docs that referenced this pull request Oct 6, 2022
* [TimescaleDB] Continue moving frontmatter

Co-authored-by: Lana Brindley <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants