Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillaumefalourd/diff-action
Github Action to compare 2 files using diff 🕵️
https://github.com/guillaumefalourd/diff-action
all-os-supported compare-files diff github-actions testing useful utilities
Last synced: 2 days ago
JSON representation
Github Action to compare 2 files using diff 🕵️
- Host: GitHub
- URL: https://github.com/guillaumefalourd/diff-action
- Owner: GuillaumeFalourd
- License: apache-2.0
- Created: 2021-06-16T16:13:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-17T21:42:50.000Z (over 3 years ago)
- Last Synced: 2024-10-19T20:15:04.372Z (27 days ago)
- Topics: all-os-supported, compare-files, diff, github-actions, testing, useful, utilities
- Homepage:
- Size: 53.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# diff-action
[![Diff Action Test (FILE Passed)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_file_passed.yml/badge.svg)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_file_passed.yml) [![Diff Action Test (FILE Failed)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_file_failed.yml/badge.svg)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_file_failed.yml)
[![Diff Action Test (LINE Passed)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_line_passed.yml/badge.svg)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_line_passed.yml) [![Diff Action Test (LINE Failed)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_line_failed.yml/badge.svg)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_line_failed.yml)
![diff-action](https://user-images.githubusercontent.com/22433243/122283163-a4df3180-cec2-11eb-99e1-0561639adf29.png)
Github Action to compare 2 files using [diff](http://www.linuxguide.it/command_line/linux-manpage/do.php?file=diff) 🕵️
* * *
## 🖥 Supported OS
OS | SUPPORTED
---------- | ------------
**LINUX** | YES
**MACOS** | YES
**WINDOWS** | YES## 📚 How to use this action?
The [`actions/checkout`](https://github.com/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.
* * *
### 🕵️📋 Comparing 2 files
#### Expecting files to be identicals
```yaml
steps:
- uses: actions/[email protected]
- uses: GuillaumeFalourd/diff-action@v1
with:
first_file_path: path/to/file1.txt
second_file_path: path/to/file2.txt
expected_result: PASSED
```#### Expecting files to be differents
```yaml
steps:
- uses: actions/[email protected]
- uses: GuillaumeFalourd/diff-action@v1
with:
first_file_path: path/to/file1.txt
second_file_path: path/to/file2.txt
expected_result: FAILED
```### 🕵📝 Comparing 2 lines
#### Expecting lines to be identicals
```yaml
steps:
- uses: actions/[email protected]
- 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
```#### Expecting lines to be differents
```yaml
steps:
- uses: actions/[email protected]
- 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 examples returning error
[![Diff Action Test (FILE Error)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_file_error.yml/badge.svg)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_file_error.yml) : [Workflow with test returning ERROR (File) 📋](https://github.com/GuillaumeFalourd/diff-action/blob/main/.github/workflows/test_file_error.yml)
[![Diff Action Test (LINE Error)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_line_error.yml/badge.svg)](https://github.com/GuillaumeFalourd/diff-action/actions/workflows/test_line_error.yml) : [Workflow with test returning ERROR (Line) 📝](https://github.com/GuillaumeFalourd/diff-action/blob/main/.github/workflows/test_line_error.yml)
## Licensed
This repository uses the [Apache License 2.0](https://github.com/GuillaumeFalourd/aws-cliaction/blob/main/LICENSE)