Skip to content

Commit 71dd0b8

Browse files
committed
docs: update documentation
1 parent 69ff299 commit 71dd0b8

File tree

1 file changed

+54
-4
lines changed

1 file changed

+54
-4
lines changed

README.md

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,46 @@
11
# detect-changes-action
22

3-
## Description
4-
53
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)
4+
5+
## Available Features
6+
- Get list of directories changed in a PR
7+
- Get list of files changed in a PR
8+
9+
## Usage
10+
<details><summary><strong> Get a list of paths to use in a matrix of jobs</strong></summary>
11+
12+
```yaml
13+
name: 'PR Detect changes'
14+
on:
15+
pull_request:
16+
types: [synchronize, opened, reopened, labeled]
17+
branches:
18+
- main
19+
jobs:
20+
changes:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
packages: ${{ steps.filter.outputs.paths_changed }}
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: Annotate PR
27+
id: filter
28+
uses: fabidick22/detect-changes-action@v1
29+
with:
30+
path: "modules/"
31+
32+
build:
33+
needs: changes
34+
strategy:
35+
matrix:
36+
package: ${{ fromJSON(needs.changes.outputs.packages) }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- run: echo '${{ matrix.package }}'
40+
```
41+
</details>
42+
43+
<!-- action-docs-inputs -->
644
## Inputs
745
846
| parameter | description | required | default |
@@ -11,15 +49,27 @@ Action to get paths and files changed in a Pull Request event and use these for
1149
| token | The token to use to access the GitHub API | `false` | ${{ github.token }} |
1250

1351

52+
53+
<!-- action-docs-inputs -->
54+
55+
<!-- action-docs-outputs -->
1456
## Outputs
1557

1658
| parameter | description |
1759
| - | - |
18-
| paths_changed | List of changed paths, example: ``` ["dist", "dist/data"] ```|
19-
| file_changed | List of changed files, example: ``` ["dist/main.tf", "dist/index.js"] ```|
60+
| paths_changed | List of changed paths, example: ``` ["dist", "dist/data"] ```
61+
|
62+
| file_changed | List of changed files, example: ``` ["dist/main.tf", "dist/index.js"] ```
63+
|
64+
2065

2166

67+
<!-- action-docs-outputs -->
68+
69+
<!-- action-docs-runs -->
2270
## Runs
2371

2472
This action is a `node16` action.
2573

74+
75+
<!-- action-docs-runs -->

0 commit comments

Comments
 (0)