Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Jun 27, 2021
1 parent 222e7c3 commit 7730975
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# verify-changed-files

Verify that certain files did or did not change during the workflow execution.
Verify that a list of files did or didn't change during the workflow execution.

## Features

Expand All @@ -26,7 +26,7 @@ Verify that certain files did or did not change during the workflow execution.
> * This action only detects files that have pending uncommited changes generated during the workflow execution, for running a specific step when a file changes relative to the default branch or previous commit
>
> See: https://github.com/tj-actions/changed-files
> * Detects files that were `Added`, `Copied`, `Modified`, `Unmerged`, `Unknown`, `Type changed`, `Unstaged` and `Renamed`.
> * Detects files that were `Added`, `Copied`, `Modified`, `Unmerged`, `Unknown`, had their `Type changed`, `Unstaged` and `Renamed`.
```yaml
...
Expand All @@ -52,16 +52,11 @@ Verify that certain files did or did not change during the workflow execution.
.(sql)$
^(mynewfile|custom)
- name: Display changed files
- name: Run step only when files change.
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
echo "Changed files: ${{ steps.verify_changed_files.outputs.changed_files }}"
# Outputs: "Changed files: new.txt test_directory/new.txt"

- name: Perform action when files change.
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
echo "Do something when files have changed."
```

#### Using the [`contains`](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#contains) function.
Expand All @@ -86,14 +81,14 @@ Verify that certain files did or did not change during the workflow execution.
| Input | type | required | default | description |
|:-------------:|:-----------:|:--------------:|:-----------------------------:|:--------------------------:|
| token | `string` | `true` | `${{ github.token }}` <br/> | github action default token or PAT token |
| files | `array` | `true` | | List of file(s)/directory names <br/> (regex optional) to check for changes <br/> during workflow execution |
| token | `string` | `true` | `${{ github.token }}` <br/> | [GITHUB_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
| files | `string[]` OR `string` | `true` | | Check for uncommited changes <br> using only these list of file(s) |

## Outputs

| Input | type | example | description |
|:-------------:|:-----------:|:-------------:|:--------------------------:|
| files_changed | `string` | `true` OR `false` | Indicates that there are outstanding changes |
| files_changed | `boolean` | `true` OR `false` | Indicates that there are outstanding changes |
| changed_files | `string` | `example.txt ...` | List of file(s)/directory names <br/> that changed <br/> during the workflow execution |

* Free software: [MIT license](LICENSE)
Expand Down

0 comments on commit 7730975

Please sign in to comment.