Skip to content

Commit 0dd5ada

Browse files
committed
doc: update readme
1 parent a2bf9a8 commit 0dd5ada

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

README.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,38 @@
22

33
This action adds a prefix to the default Code of Conduct template and applies the necessary templates.
44

5-
## Example usage
5+
If used with `gr2m/create-or-update-pull-request-action@v1` workflow automatically creates a pull
6+
request with the applied changes.
7+
8+
- Opens a pull request if output file does not exist [(Example)](https://github.com/anonrig/patch-test/pull/1)
9+
- Opens a pull request if patch file is changed [(Example)](https://github.com/anonrig/patch-test/pull/7)
10+
11+
## Example Workflow
612

713
```yaml
8-
uses: @anonrig/patch-my-code-of-conduct@v1
9-
with:
10-
base_file_path: './base.md'
11-
patch_file_path: './patch_file'
12-
output_file_path: '../../CODE_OF_CONDUCT.md'
14+
on: [push]
15+
16+
jobs:
17+
main_job:
18+
runs-on: ubuntu-latest
19+
name: Test Action
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
with:
24+
persist-credentials: false
25+
- name: Start Patch
26+
uses: anonrig/[email protected]
27+
with:
28+
base_file_path: './base.md'
29+
patch_file_path: './patch'
30+
output_file_path: './CODE_OF_CONDUCT.md'
31+
- uses: gr2m/create-or-update-pull-request-action@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
body: "Applied the patch to the base Code of Conduct."
36+
branch: actions/patch-code-of-conduct # Custom branch *just* for this Action.
37+
commit-message: 'doc: update Code of Conduct'
38+
title: 'doc: update Code of Conduct'
1339
```

0 commit comments

Comments
 (0)