Github Action to compare 2 files using diff ๐ต๏ธ
OS | SUPPORTED |
---|---|
LINUX | YES |
MACOS | YES |
WINDOWS | YES |
The actions/checkout
is mandatory to use this action, as it will need to access the repository files.
Field | Mandatory | Observation |
---|---|---|
first_file_path | YES | ex: path/to/file1.txt |
second_file_path | YES | ex: path/to/file2.txt |
expected_result | NO | PASSED (default) or FAILED |
specific_line | NO | ex: 1 (integer value only) |
Will return FAIL: If the diff
output of the 2 files/lines is different than the expected_result
input value.
Will return SUCCESS: If the diff
output of the 2 files/lines is equal the expected_result
input value.
steps:
- uses: actions/checkout@v2.3.4
- uses: GuillaumeFalourd/diff-action@v1
with:
first_file_path: path/to/file1.txt
second_file_path: path/to/file2.txt
expected_result: PASSED
steps:
- uses: actions/checkout@v2.3.4
- uses: GuillaumeFalourd/diff-action@v1
with:
first_file_path: path/to/file1.txt
second_file_path: path/to/file2.txt
expected_result: FAILED
steps:
- uses: actions/checkout@v2.3.4
- uses: GuillaumeFalourd/diff-action@v1
with:
first_file_path: path/to/file1.txt
second_file_path: path/to/file2.txt
specific_line: 3
expected_result: PASSED
steps:
- uses: actions/checkout@v2.3.4
- uses: GuillaumeFalourd/diff-action@v1
with:
first_file_path: path/to/file1.txt
second_file_path: path/to/file2.txt
specific_line: 3
expected_result: FAILED
: Workflow with test returning ERROR (File) ๐
: Workflow with test returning ERROR (Line) ๐
This repository uses the Apache License 2.0