Skip to content

Commit

Permalink
docs: put failure example first
Browse files Browse the repository at this point in the history
  • Loading branch information
edganiukov committed May 25, 2023
1 parent f71e251 commit 15b09d3
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ to a GitHub Runner. The action will fail if neither `authorized-users` nor

# Usage

These examples show how you can define a step in a workflow job. The action can
pause workflow jobs at any step:
The following example shows how to define a step in a GitHub Actions job to run
`breakpoint` in case of job's failure (so it won't pause successful runs):

```yaml
jobs:
Expand All @@ -50,23 +50,19 @@ jobs:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Build images
- name: Run tests
shell: bash
run: docker build .
run: ...

- name: Breakpoint to check the build results
- name: Breakpoint if tests failed
if: failure()
uses: namespacelabs/breakpoint-action@v0
with:
duration: 30m
authorized-users: jack123, alice321

- name: Run tests
shell: bash
run: ...
```
Or it can be use to pause workflow jobs only on failures (so it won't pause
successful runs):
Or it can pause workflow jobs at any step:
```yaml
jobs:
Expand All @@ -81,14 +77,17 @@ jobs:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Run tests
- name: Build images
shell: bash
run: ...
run: docker build .

- name: Breakpoint if tests failed
if: failure()
- name: Breakpoint to check the build results
uses: namespacelabs/breakpoint-action@v0
with:
duration: 30m
authorized-users: jack123, alice321

- name: Run tests
shell: bash
run: ...
```

0 comments on commit 15b09d3

Please sign in to comment.