Skip to content

Jaronline/action-assertions

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub Actions for Assertions

OpenSSF Scorecard

This repository contains a collection of GitHub Actions designed to assert various conditions in your workflows. These actions can be used to validate outputs, check file existence, and compare values.

Assert Equals

The assert-equals action checks if two values are equal and fails the workflow if they are not.

Example Usage

name: Test

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Assert Equal
        uses: jaronline/action-assertions/assert-equals@v1
        with:
            expected: 'main'
            actual: ${{ github.ref_name }}
            message: 'Values are not equal!' # Optional

Assert Not Equals

The assert-not-equals action checks if two values are not equal and fails the workflow if they are.

Example Usage

name: Test

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Assert Not Equal
        uses: jaronline/action-assertions/assert-not-equals@v1
        with:
            unexpected: 'main'
            actual: ${{ github.ref_name }}
            message: 'Values should not be equal!' # Optional

Assert Path Exists

The assert-path-exists action checks if a specified path exists in the repository. If the path does not exist, the action fails the workflow.

Example Usage

name: Test

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Assert Path Exists
        uses: jaronline/action-assertions/assert-path-exists@v1
        with:
            path: 'path/to/your/file.txt'
            message: 'Path does not exist!' # Optional

Assert Path Not Exists

The assert-path-not-exists action checks if a specified path does not exist in the repository. If the path exists, the action fails the workflow.

Example Usage

name: Test

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Assert Path Not Exists
        uses: jaronline/action-assertions/assert-path-not-exists@v1
        with:
            path: 'path/to/your/file.txt'
            message: 'Path should not exist!' # Optional

About

A collection of GitHub actions that allow you to do assertions in other GitHub actions or workflows

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Sponsor this project

  •  

Contributors