Skip to content

Commit 455ffb9

Browse files
Enhance README with better example
1 parent 1075a91 commit 455ffb9

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,24 @@ This GitHub Action will clean up and format your CODEOWNERS file.
99
### Example
1010

1111
```yaml
12+
---
13+
name: Format CODEOWNERS
14+
15+
on:
16+
push:
17+
branches:
18+
- main
19+
paths:
20+
- 'CODEOWNERS'
21+
22+
jobs:
23+
format-codeowners:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
1228
- uses: Archetypically/format-codeowners@v1
29+
id: format-codeowners
1330
with:
1431
# Optional. The path to the CODEOWNERS file to format. Will auto-detect if not passed in.
1532
file-path: CODEOWNERS
@@ -61,6 +78,7 @@ Note: this Action will not commit files back to the repository; you can use some
6178

6279
```yaml
6380
- uses: stefanzweifel/git-auto-commit-action@v4
81+
if: steps.format-codeowners.outputs.formatted-files != ''
6482
with:
6583
# Optional. Commit message for the created commit.
6684
# Defaults to "Apply automatic changes"
@@ -75,7 +93,7 @@ Note: this Action will not commit files back to the repository; you can use some
7593
# See the `pathspec`-documentation for git
7694
# - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203
7795
# - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
78-
file_pattern: CODEOWNERS .github/CODEOWNERS docs/CODEOWNERS
96+
file_pattern: ${{ steps.format-codeowners.outputs.formatted-files }}
7997

8098
# Optional. Prevents the shell from expanding filenames.
8199
# Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html

0 commit comments

Comments
 (0)