Skip to content

Commit

Permalink
fix: fixed example in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Fields committed Sep 29, 2020
1 parent e8ab059 commit a5e5458
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 6 deletions.
73 changes: 70 additions & 3 deletions .actiongenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,81 @@ module.exports = buildConfig({
},
usage: {
examples: [
{
title: 'Example usage w/ exact (using default comparison) assertion',
codeLanguage: 'yaml',
codeBlock: `
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: testing
actual: \${{ steps.test-data.outputs.value }}
`.trim(),
},
{
title: 'Example usage w/ exact assertion',
codeLanguage: 'yaml',
codeBlock: `
- uses: nick-invision@assert-actionv1
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: testing
actual: \${{ steps.test-data.outputs.value }}
comparison: exact
`.trim(),
},
{
title: 'Example usage w/ startsWith assertion',
codeLanguage: 'yaml',
codeBlock: `
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: test
actual: \${{ steps.test-data.outputs.value }}
comparison: startsWith
`.trim(),
},
{
title: 'Example usage w/ endsWith assertion',
codeLanguage: 'yaml',
codeBlock: `
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: ing
actual: \${{ steps.test-data.outputs.value }}
comparison: endsWith
`.trim(),
},
{
title: 'Example usage w/ contains assertion',
codeLanguage: 'yaml',
codeBlock: `
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: est
actual: \${{ steps.test-data.outputs.value }}
comparison: endsWith
`.trim(),
},
{
title: 'Example usage w/ notEqual assertion',
codeLanguage: 'yaml',
codeBlock: `
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: \${{ secrets.REPO_TOKEN }}
actual: \${{ steps.outputs }}
expected: abc
actual: \${{ steps.test-data.outputs.value }}
comparison: notEqual
`.trim(),
},
],
Expand Down
68 changes: 65 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,75 @@ Various assertions to aide in validating action outputs

## **Examples**

### Example usage w/ exact (using default comparison) assertion

```yaml
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: testing
actual: ${{ steps.test-data.outputs.value }}
```
### Example usage w/ exact assertion
```yaml
- uses: nick-invision@assert-actionv1
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: testing
actual: ${{ steps.test-data.outputs.value }}
comparison: exact
```
### Example usage w/ startsWith assertion
```yaml
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: test
actual: ${{ steps.test-data.outputs.value }}
comparison: startsWith
```
### Example usage w/ endsWith assertion
```yaml
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: ing
actual: ${{ steps.test-data.outputs.value }}
comparison: endsWith
```
### Example usage w/ contains assertion
```yaml
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: est
actual: ${{ steps.test-data.outputs.value }}
comparison: endsWith
```
### Example usage w/ notEqual assertion
```yaml
- id: test-data
run: echo "::set-output name=value::testing"
- uses: nick-invision@assert-action@v1
with:
expected: ${{ secrets.REPO_TOKEN }}
actual: ${{ steps.outputs }}
expected: abc
actual: ${{ steps.test-data.outputs.value }}
comparison: notEqual
```
---
Expand Down

0 comments on commit a5e5458

Please sign in to comment.