-
Notifications
You must be signed in to change notification settings - Fork 61k
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
Add documentation for conditional composite steps (runs.steps[*].if
)
#12378
Conversation
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 changesYou 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.
|
@fhammerl |
content/actions/creating-actions/metadata-syntax-for-github-actions.md
Outdated
Show resolved
Hide resolved
|
||
**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)." |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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' }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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.
There was a problem hiding this 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)." |
There was a problem hiding this comment.
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)?
Deconstruction explained: https://docs-12378--composite-action-s.herokuapp.com/en/actions/learn-github-actions/expressions#evaluate-status-explicitly Pre-if and Post-if: https://docs-12378--composite-action-s.herokuapp.com/en/actions/creating-actions/metadata-syntax-for-github-actions#pre @thboop Let me know what you think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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.
This works now. See github/docs#12378 This reverts commit 25b2dd4.
…ticle) #12378 (#48685) Co-authored-by: Siara <[email protected]>
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:
Writer impact (This section is for GitHub staff members only):