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

READY: Add option steps_context #156

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ It is a cause of failed jobs. For this case, the action `wretry.action` can retr
- The repository includes subdirectories with alternative action setups that can skip the `pre` or/and `post` stages, as necessary.
- Action handles conditions in `JavaScript` and `Docker` actions ( fields `pre-if` and `post-if` ). Some conditions can be unsolvable and then action skips the stage.
- Resolves external action default inputs from next contexts : `github`, `env`, `job`, `matrix`, `inputs`.
- Can resolve user-provided context `steps`.
- Retries actions with defined number of attempts ( default is 2 ).
- Retries actions with defined delay between attempts ( default is 0 ).

Expand Down Expand Up @@ -81,6 +82,10 @@ An example of declaration of option with multiline string :

Setup working directory for the action. Works with only commands. Default is `github.workspace` path.

### `steps_context`

Pass context `steps` into an external action. The action cannot resolve runtime context `steps` from environment contexts. If you need valid context `steps`, then add option `steps_context : ${{ toJSON( steps ) }}`.

### `attempt_limit`

Set number of attempts. Default is 2.
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
Setup working directory for the action. Works with only commands. Default
is `github.workspace` path.
required: false
steps_context:
description: 'Pass context `steps` into an external action. If you need valid context `steps`, then add option as described in `Readme.md`.'
required: false
default: '{}'
attempt_limit:
description: Number of attempts
required: false
Expand Down Expand Up @@ -59,6 +63,7 @@ runs:
command: '${{ inputs.command }}'
with: '${{ inputs.with }}'
current_path: '${{ inputs.current_path }}'
steps_context: '${{ inputs.steps_context }}'
attempt_limit: '${{ inputs.attempt_limit }}'
attempt_delay: '${{ inputs.attempt_delay }}'
retry_condition: '${{ inputs.retry_condition }}'
Expand Down
5 changes: 5 additions & 0 deletions main/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
Setup working directory for the action. Works with only commands. Default
is `github.workspace` path.
required: false
steps_context:
description: 'Pass context `steps` into an external action. If you need valid context `steps`, then add option as described in `Readme.md`.'
required: false
default: '{}'
attempt_limit:
description: Number of attempts
required: false
Expand Down Expand Up @@ -59,6 +63,7 @@ runs:
command: '${{ inputs.command }}'
with: '${{ inputs.with }}'
current_path: '${{ inputs.current_path }}'
steps_context: '${{ inputs.steps_context }}'
attempt_limit: '${{ inputs.attempt_limit }}'
attempt_delay: '${{ inputs.attempt_delay }}'
retry_condition: '${{ inputs.retry_condition }}'
Expand Down
5 changes: 5 additions & 0 deletions post/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
Setup working directory for the action. Works with only commands. Default
is `github.workspace` path.
required: false
steps_context:
description: 'Pass context `steps` into an external action. If you need valid context `steps`, then add option as described in `Readme.md`.'
required: false
default: '{}'
attempt_limit:
description: Number of attempts
required: false
Expand Down Expand Up @@ -59,6 +63,7 @@ runs:
command: '${{ inputs.command }}'
with: '${{ inputs.with }}'
current_path: '${{ inputs.current_path }}'
steps_context: '${{ inputs.steps_context }}'
attempt_limit: '${{ inputs.attempt_limit }}'
attempt_delay: '${{ inputs.attempt_delay }}'
retry_condition: '${{ inputs.retry_condition }}'
Expand Down
5 changes: 5 additions & 0 deletions pre/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
Setup working directory for the action. Works with only commands. Default
is `github.workspace` path.
required: false
steps_context:
description: 'Pass context `steps` into an external action. If you need valid context `steps`, then add option as described in `Readme.md`.'
required: false
default: '{}'
attempt_limit:
description: Number of attempts
required: false
Expand Down Expand Up @@ -59,6 +63,7 @@ runs:
command: '${{ inputs.command }}'
with: '${{ inputs.with }}'
current_path: '${{ inputs.current_path }}'
steps_context: '${{ inputs.steps_context }}'
attempt_limit: '${{ inputs.attempt_limit }}'
attempt_delay: '${{ inputs.attempt_delay }}'
retry_condition: '${{ inputs.retry_condition }}'
Expand Down