Skip to content

Commit

Permalink
Add alternative actions in subdirectories, skip extra stages if it is…
Browse files Browse the repository at this point in the history
… required
  • Loading branch information
dmvict committed Apr 9, 2024
1 parent c58287b commit c4999d5
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 1 deletion.
5 changes: 5 additions & 0 deletions main/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua)

# action::retry [![status](https://github.com/Wandalen/wretry.action/actions/workflows/wRetryActionPublish.yml/badge.svg)](https://github.com/Wandalen/wretry.action/actions/workflows/wRetryActionPublish.yml) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](https://github.com/emersion/stability-badges#stable)

An alternative [action](../Readme.md) declaration that skips `pre` and `post` stages. It is useful for retrying actions with only `main` stage.
64 changes: 64 additions & 0 deletions main/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'js retry action'
author : |
Wandalen <wandalen@obox.systems>
dmvict <dm.vict.kr@gmail.com>
branding:
icon: 'activity'
color: 'white'
description: 'Retries an Github Action step on failure'
inputs:
action:
description: 'Github action name. Should be defined action or command, not both.'
required: false
command:
description: 'Command to run. Should be defined action or command, not both.'
required: false
with:
description: 'An options map for Github action'
required: false
current_path:
description: 'Setup working directory for the action. Works with only commands. Default is `github.workspace` path.'
required: false
env_context:
description: 'Pass context `env` into an external action. Action cannot resolve separate environments of workflow at the startup and provide all environments. If you need valid context `env`, then add option `env_context` with environments.'
required: false
default: '{}'
github_context:
description: 'Pass context `github` into an external action. Default is global context `github`.'
required: false
default: ${{ toJSON( github ) }}
job_context:
description: 'Pass context `job` into an external action. Default is context `job` of a job.'
required: false
default: ${{ toJSON( job ) }}
matrix_context:
description: 'Pass context `matrix` into an external action. Default is context `matrix` of a job.'
required: false
default: ${{ toJSON( matrix ) }}
inputs_context:
description: 'Pass context `inputs` into an external action. The action cannot resolve context `inputs` and resolve all inputs. If you need valid context `inputs`, then add option as described in `Readme.md`.'
required: false
default: '{}'
attempt_limit:
description: 'Number of attempts'
required: false
default: 2
attempt_delay:
description: 'A delay between attempts in ms'
required: false
default: 0
time_out:
description: 'Set time out in ms for entire step including all retries. By default actions sets no time out.'
required: false
default: false
retry_condition:
description: 'Use any valid expression to decide the continuation of retries. Default value is true.'
required: false
default: true
github_token:
description: 'A token to access private actions. Does not required for public actions.'
required: false
default: ${{ github.token }}
runs:
using: 'node20'
main: '../src/Main.js'
5 changes: 5 additions & 0 deletions post/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua)

# action::retry [![status](https://github.com/Wandalen/wretry.action/actions/workflows/wRetryActionPublish.yml/badge.svg)](https://github.com/Wandalen/wretry.action/actions/workflows/wRetryActionPublish.yml) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](https://github.com/emersion/stability-badges#stable)

An alternative [action](../Readme.md) declaration that skips `pre` stage. It is useful for retrying actions with `post` stage.
65 changes: 65 additions & 0 deletions post/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'js retry action'
author : |
Wandalen <wandalen@obox.systems>
dmvict <dm.vict.kr@gmail.com>
branding:
icon: 'activity'
color: 'white'
description: 'Retries an Github Action step on failure'
inputs:
action:
description: 'Github action name. Should be defined action or command, not both.'
required: false
command:
description: 'Command to run. Should be defined action or command, not both.'
required: false
with:
description: 'An options map for Github action'
required: false
current_path:
description: 'Setup working directory for the action. Works with only commands. Default is `github.workspace` path.'
required: false
env_context:
description: 'Pass context `env` into an external action. Action cannot resolve separate environments of workflow at the startup and provide all environments. If you need valid context `env`, then add option `env_context` with environments.'
required: false
default: '{}'
github_context:
description: 'Pass context `github` into an external action. Default is global context `github`.'
required: false
default: ${{ toJSON( github ) }}
job_context:
description: 'Pass context `job` into an external action. Default is context `job` of a job.'
required: false
default: ${{ toJSON( job ) }}
matrix_context:
description: 'Pass context `matrix` into an external action. Default is context `matrix` of a job.'
required: false
default: ${{ toJSON( matrix ) }}
inputs_context:
description: 'Pass context `inputs` into an external action. The action cannot resolve context `inputs` and resolve all inputs. If you need valid context `inputs`, then add option as described in `Readme.md`.'
required: false
default: '{}'
attempt_limit:
description: 'Number of attempts'
required: false
default: 2
attempt_delay:
description: 'A delay between attempts in ms'
required: false
default: 0
time_out:
description: 'Set time out in ms for entire step including all retries. By default actions sets no time out.'
required: false
default: false
retry_condition:
description: 'Use any valid expression to decide the continuation of retries. Default value is true.'
required: false
default: true
github_token:
description: 'A token to access private actions. Does not required for public actions.'
required: false
default: ${{ github.token }}
runs:
using: 'node20'
main: '../src/Main.js'
post: '../src/Post.js'
5 changes: 5 additions & 0 deletions pre/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua)

# action::retry [![status](https://github.com/Wandalen/wretry.action/actions/workflows/wRetryActionPublish.yml/badge.svg)](https://github.com/Wandalen/wretry.action/actions/workflows/wRetryActionPublish.yml) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](https://github.com/emersion/stability-badges#stable)

An alternative [action](../Readme.md) declaration that skips `post` stage. It is useful for retrying actions with `pre` stage.
65 changes: 65 additions & 0 deletions pre/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'js retry action'
author : |
Wandalen <wandalen@obox.systems>
dmvict <dm.vict.kr@gmail.com>
branding:
icon: 'activity'
color: 'white'
description: 'Retries an Github Action step on failure'
inputs:
action:
description: 'Github action name. Should be defined action or command, not both.'
required: false
command:
description: 'Command to run. Should be defined action or command, not both.'
required: false
with:
description: 'An options map for Github action'
required: false
current_path:
description: 'Setup working directory for the action. Works with only commands. Default is `github.workspace` path.'
required: false
env_context:
description: 'Pass context `env` into an external action. Action cannot resolve separate environments of workflow at the startup and provide all environments. If you need valid context `env`, then add option `env_context` with environments.'
required: false
default: '{}'
github_context:
description: 'Pass context `github` into an external action. Default is global context `github`.'
required: false
default: ${{ toJSON( github ) }}
job_context:
description: 'Pass context `job` into an external action. Default is context `job` of a job.'
required: false
default: ${{ toJSON( job ) }}
matrix_context:
description: 'Pass context `matrix` into an external action. Default is context `matrix` of a job.'
required: false
default: ${{ toJSON( matrix ) }}
inputs_context:
description: 'Pass context `inputs` into an external action. The action cannot resolve context `inputs` and resolve all inputs. If you need valid context `inputs`, then add option as described in `Readme.md`.'
required: false
default: '{}'
attempt_limit:
description: 'Number of attempts'
required: false
default: 2
attempt_delay:
description: 'A delay between attempts in ms'
required: false
default: 0
time_out:
description: 'Set time out in ms for entire step including all retries. By default actions sets no time out.'
required: false
default: false
retry_condition:
description: 'Use any valid expression to decide the continuation of retries. Default value is true.'
required: false
default: true
github_token:
description: 'A token to access private actions. Does not required for public actions.'
required: false
default: ${{ github.token }}
runs:
using: 'node20'
pre: '../src/Pre.js'
main: '../src/Main.js'
1 change: 0 additions & 1 deletion src/Docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if( _.map.keys( common ).length === 0 )
const path = require.resolve( './Common.js' );
common = require.cache[ path ].exports;
}
let GithubActionsParser = null;

//

Expand Down

0 comments on commit c4999d5

Please sign in to comment.