Skip to content

Latest commit

Β 

History

History
100 lines (72 loc) Β· 4.06 KB

README.md

File metadata and controls

100 lines (72 loc) Β· 4.06 KB

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/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

Expecting files to be differents

    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

πŸ•΅πŸ“ Comparing 2 lines

Expecting lines to be identicals

    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

Expecting lines to be differents

    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 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