Skip to content

Commit

Permalink
Update README and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Nov 17, 2022
1 parent 53f6014 commit 27afc82
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
with:
command: true

test-fail-command:
name: test fail command
test-fail-command-1:
name: test fail command 1
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -35,3 +35,22 @@ jobs:
echo "This command has failed" \
&& echo "Failed command concatenated"
continue-on-error: true

test-fail-command-2:
name: test fail command 2
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: retry
uses: ./
with:
command: false
retries: 2
pause: 1
fail_command: |
sudo sysctl -w net.ipv4.ip_forward=1 \
&& sudo systemctl restart docker
continue-on-error: true
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ This action allows you to retry shell command for a few times in case they fail.

The following inputs can be used to alter the Docker tag name determination:

| Input | Required | Default | Description |
|-----------|----------|----------|-------------------------------------------|
| `retries` | No | `10` | How many times to retry on failure. |
| `pause` | No | `10` | How many seconds to wait between retries. |
| `command` | Yes | `` | Shell command to execute |
| `workdir` | No | `` | Switch to this working directory prior executing the shell command |
| Input | Required | Default | Description |
|----------------|----------|----------|-------------------------------------------|
| `retries` | No | `10` | How many times to retry on failure. |
| `pause` | No | `10` | How many seconds to wait between retries. |
| `command` | Yes | `` | Shell command to execute. |
| `workdir` | No | `` | Switch to this working directory prior executing the shell command. |
| `fail_command` | No | `` | Shell command to execute on every failure of given `command`. |


## :arrow_backward: Outputs
Expand Down Expand Up @@ -48,6 +49,9 @@ jobs:
pause: 10
command: |
docker build -t test .
fail_command: |
sudo sysctl -w net.ipv4.ip_forward=1 \
&& sudo systemctl restart docker \
```
Expand Down

0 comments on commit 27afc82

Please # to comment.