Skip to content

Commit

Permalink
docs: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fabidick22 committed Jul 6, 2022
1 parent 69ff299 commit 71dd0b8
Showing 1 changed file with 54 additions and 4 deletions.
58 changes: 54 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,46 @@
# detect-changes-action

## Description

Action to get paths and files changed in a Pull Request event and use these for [GitHub Actions matrix](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs)

## Available Features
- Get list of directories changed in a PR
- Get list of files changed in a PR

## Usage
<details><summary><strong> Get a list of paths to use in a matrix of jobs</strong></summary>

```yaml
name: 'PR Detect changes'
on:
pull_request:
types: [synchronize, opened, reopened, labeled]
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.filter.outputs.paths_changed }}
steps:
- uses: actions/checkout@v3
- name: Annotate PR
id: filter
uses: fabidick22/detect-changes-action@v1
with:
path: "modules/"

build:
needs: changes
strategy:
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
runs-on: ubuntu-latest
steps:
- run: echo '${{ matrix.package }}'
```
</details>
<!-- action-docs-inputs -->
## Inputs
| parameter | description | required | default |
Expand All @@ -11,15 +49,27 @@ Action to get paths and files changed in a Pull Request event and use these for
| token | The token to use to access the GitHub API | `false` | ${{ github.token }} |



<!-- action-docs-inputs -->

<!-- action-docs-outputs -->
## Outputs

| parameter | description |
| - | - |
| paths_changed | List of changed paths, example: ``` ["dist", "dist/data"] ```|
| file_changed | List of changed files, example: ``` ["dist/main.tf", "dist/index.js"] ```|
| paths_changed | List of changed paths, example: ``` ["dist", "dist/data"] ```
|
| file_changed | List of changed files, example: ``` ["dist/main.tf", "dist/index.js"] ```
|



<!-- action-docs-outputs -->

<!-- action-docs-runs -->
## Runs

This action is a `node16` action.


<!-- action-docs-runs -->

0 comments on commit 71dd0b8

Please sign in to comment.