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

Add documentation for conditional composite steps (runs.steps[*].if) #12378

Merged
merged 7 commits into from
Jan 4, 2022
Merged

Add documentation for conditional composite steps (runs.steps[*].if) #12378

merged 7 commits into from
Jan 4, 2022

Conversation

fhammerl
Copy link
Contributor

@fhammerl fhammerl commented Nov 26, 2021

Why:

People creating composite actions could not use conditional steps before. Changing the docs would make this change more explicit.

What's being changed:

By merging actions/runner#1438, we started supporting conditional composite steps.

Added a new paragraph: https://docs-12378--composite-action-s.herokuapp.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif

Check off the following:

  • I have reviewed my changes in staging (look for "Automatically generated comment" and click Modified to view your latest changes).
  • For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

  • This pull request impacts the contribution experience
    • I have added the 'writer impact' label
    • I have added a description and/or a video demo of the changes below (e.g. a "before and after video")

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Nov 26, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2021

Automatically generated comment ℹ️

This comment is automatically generated and will be overwritten every time changes are committed to this branch.

The table contains an overview of files in the content directory that have been changed in this pull request. It's provided to make it easy to review your changes on the staging site. Please note that changes to the data directory will not show up in this table.


Content directory changes

You may find it useful to copy this table into the pull request summary. There you can edit it to share links to important articles or changes and to give a high-level overview of how the changes in your pull request support the overall goals of the pull request.

Source Staging Production What Changed
content/actions/creating-actions/metadata-syntax-for-github-actions.md Modified Original
content/actions/learn-github-actions/expressions.md Modified Original

@ramyaparimi ramyaparimi added content This issue or pull request belongs to the Docs Content team waiting for review Issue/PR is waiting for a writer's review and removed triage Do not begin working on this issue until triaged by the team labels Nov 29, 2021
@ramyaparimi
Copy link
Contributor

@fhammerl
Thanks so much for opening a PR! I'll get this triaged for review ⚡


**Example: Using status check functions**

The `my backup step` only runs when the previous step of a composite action fails. For more information, see "[Expressions](/actions/learn-github-actions/expressions#job-status-check-functions)."
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth adding a footnote or something to this page to indicate that in composite actions these refer to the success/failure of the composite action not the job

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. Should we also distinguish between composite step-if (depends on composite action's success) from pre-if and post-if (depends on job's success)?

What do you think about this:

Rename Job Status Check Expressions to Status Check Expressions, explain that these expressions can be deconstructed using job.status in a job.step and github.action_status in a composite.step, respectively, and show some examples like you mentioned: if: ${{ github.action_status == 'failure' }}

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me

Copy link
Contributor

Choose a reason for hiding this comment

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

If a user is using a third party action, will it be obvious to them whether the action is a composite action?

Or does this apply to all small-a actions (not just composite actions)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@skedwards88 This only applies to composite actions, other actions can't have conditional steps.

The idea is that maintainers of the composite action should only have to consider the action itself being successful, not the job executing it.

For example, let's say a job is failing, but its last step calls a composite action with if:always(). We want this composite action to start out with a state of success and track changes to its state independent of the job.

Copy link
Contributor

@skedwards88 skedwards88 left a comment

Choose a reason for hiding this comment

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

💖 Thanks for opening this PR! I left some preliminary comments before realizing that more changes are probably incoming. Feel free to ping me for another review once it is ready.


**Example: Using status check functions**

The `my backup step` only runs when the previous step of a composite action fails. For more information, see "[Expressions](/actions/learn-github-actions/expressions#job-status-check-functions)."
Copy link
Contributor

Choose a reason for hiding this comment

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

If a user is using a third party action, will it be obvious to them whether the action is a composite action?

Or does this apply to all small-a actions (not just composite actions)?

thboop
thboop previously approved these changes Dec 17, 2021
Copy link
Contributor

@thboop thboop left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@skedwards88 skedwards88 left a comment

Choose a reason for hiding this comment

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

Thanks for these updates! I'll get this merged down for you.

@skedwards88 skedwards88 added the ready to merge This pull request is ready to merge label Jan 4, 2022
@skedwards88 skedwards88 enabled auto-merge (squash) January 4, 2022 15:37
@skedwards88 skedwards88 merged commit 1bd90a4 into github:main Jan 4, 2022
michael-k added a commit to aexeagmbh/gh-actions-docker-compose-up that referenced this pull request Mar 23, 2023
docs-bot pushed a commit that referenced this pull request Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team ready to merge This pull request is ready to merge waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants