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.
The assert-equals action checks if two values are equal and fails the workflow if they are not.
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!' # OptionalThe assert-not-equals action checks if two values are not equal and fails the workflow if they are.
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!' # OptionalThe assert-path-exists action checks if a specified path exists in the repository.
If the path does not exist, the action fails the workflow.
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!' # OptionalThe 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.
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