Giter Club home page Giter Club logo

assert-action's Introduction

Assert Action

Various assertions to aide in validating action outputs

NOTE: Ownership of this project was transferred to my personal account nick-fields from my work account nick-invision. Details here


Inputs

expected

Required Expected value

actual

Required Actual value

comparison

Optional Type of comparison to perform. Supports exact (default), startsWith, endsWith, contains, notEqual, notStartsWith, notEndsWith, notContains


Outputs

result

Result of the comparison. Can be either passed or failed


Examples

Example usage w/ exact (using default comparison) assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: testing
    actual: ${{ steps.test-data.outputs.value }}

Example usage w/ exact assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: testing
    actual: ${{ steps.test-data.outputs.value }}
    comparison: exact

Example usage w/ startsWith assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: test
    actual: ${{ steps.test-data.outputs.value }}
    comparison: startsWith

Example usage w/ notStartsWith assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: abc
    actual: ${{ steps.test-data.outputs.value }}
    comparison: notStartsWith

Example usage w/ endsWith assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: ing
    actual: ${{ steps.test-data.outputs.value }}
    comparison: endsWith

Example usage w/ notEndsWith assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: abc
    actual: ${{ steps.test-data.outputs.value }}
    comparison: notEndsWith

Example usage w/ contains assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: est
    actual: ${{ steps.test-data.outputs.value }}
    comparison: endsWith

Example usage w/ notContains assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: est
    actual: ${{ steps.test-data.outputs.value }}
    comparison: notEndsWith

Example usage w/ notEqual assertion

- id: test-data
  run: echo "::set-output name=value::testing"
- uses: nick-fields/assert-action@v1
  with:
    expected: abc
    actual: ${{ steps.test-data.outputs.value }}
    comparison: notEqual

Limitations

  • If running on self-hosted runner, NodeJS must be installed.

Ownership

As of 2022/02/15 ownership of this project has been transferred to my personal account nick-fields from my work account nick-invision due to me leaving InVision. I am the author and have been the primary maintainer since day one and will continue to maintain this as needed.

No immediate action is required if you rely on this as GitHub handles ownership transfers pretty well. Any current workflow reference to nick-invision/assert-action@<whatever> will still work, but will just pull from nick-fields/assert-action@<whatever> instead. Who knows how long that will work, so at some point it would be beneficial to update your workflows to reflect the new owner accordingly.

assert-action's People

Contributors

belav avatar dependabot[bot] avatar nick-fields avatar nick-invision avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.