diff --git a/Readme.md b/Readme.md index cb30f1f..444c5fa 100644 --- a/Readme.md +++ b/Readme.md @@ -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 ). @@ -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. diff --git a/action.yml b/action.yml index 5c76200..7cbfadc 100644 --- a/action.yml +++ b/action.yml @@ -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 @@ -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 }}' diff --git a/main/action.yml b/main/action.yml index c77d566..4951597 100644 --- a/main/action.yml +++ b/main/action.yml @@ -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 @@ -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 }}' diff --git a/post/action.yml b/post/action.yml index 3140764..f4d2c97 100644 --- a/post/action.yml +++ b/post/action.yml @@ -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 @@ -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 }}' diff --git a/pre/action.yml b/pre/action.yml index aacfbb4..0009605 100644 --- a/pre/action.yml +++ b/pre/action.yml @@ -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 @@ -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 }}'