You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add a COMMIT_BODY option
Some GitHub actions can check for specific content in a commit message's body. For example a versionbot that checks for content like `Change-type: patch`.
This change allows the calling workflow to specify a string to use as the commit body. This string will be appended to the commit message, separated by two new lines.
Change-type: minor
Signed-off-by: Graham McCulloch <[email protected]>
* Add example of COMMIT_BODY option to README
Change-type: patch
Signed-off-by: Graham McCulloch <[email protected]>
| `GIT_EMAIL` | The e-mail address used to commit the synced files | **No** | the email of the PAT used |
101
102
| `GIT_USERNAME` | The username used to commit the synced files | **No** | the username of the PAT used |
@@ -319,6 +320,27 @@ The new branch will then be `custom-branch/SOURCE_BRANCH_NAME`.
319
320
320
321
> You can use `SOURCE_REPO_NAME` in your custom branch prefix as well and it will be replaced with the actual repo name
321
322
323
+
### Custom commit body
324
+
325
+
You can specify a custom commit body. This will be appended to the commit message, separated by two new lines. For example:
326
+
327
+
**.github/workflows/sync.yml**
328
+
329
+
```yml
330
+
- name: Run GitHub File Sync
331
+
uses: BetaHuhn/repo-file-sync-action@v1
332
+
with:
333
+
GH_PAT: ${{ secrets.GH_PAT }}
334
+
COMMIT_BODY: "Change-type: patch"
335
+
```
336
+
337
+
The above example would result in a commit message that looks something like this:
338
+
```
339
+
🔄 Synced local '<filename>' with remote '<filename>'
340
+
341
+
Change-type: patch
342
+
```
343
+
322
344
### Advanced sync config
323
345
324
346
Here's how I keep common files in sync across my repositories. The main repository [`github-files`](https://github.com/BetaHuhn/github-files) contains all the files I want to sync and the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) Action which runs on every push.
0 commit comments