Skip to content

GuillaumeFalourd/diff-action

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

diff-action

Diff Action Test (FILE Passed) Diff Action Test (FILE Failed)

Diff Action Test (LINE Passed) Diff Action Test (LINE Failed)

diff-action

Github Action to compare 2 files using diff πŸ•΅οΈ


πŸ–₯ Supported OS

OS SUPPORTED
LINUX YES
MACOS YES
WINDOWS YES

πŸ“š How to use this action?

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.


πŸ•΅οΈπŸ“‹ Comparing 2 files

Expecting files to be identicals

    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

    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

    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

    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) : Workflow with test returning ERROR (File) πŸ“‹

Diff Action Test (LINE Error) : Workflow with test returning ERROR (Line) πŸ“

Licensed

This repository uses the Apache License 2.0

About

Github Action to compare 2 files using diff πŸ•΅οΈ

Topics

Resources

License

Stars

Watchers

Forks