Replace text content and submit content
Here is the example: update time 2025-05-12 17:12:55
Here is the different delimiter example: different GAMFC_TABEL
& GAMFC_TABEL-END
(test)
Name | Required | Default | Description |
---|---|---|---|
token |
✅ | ${{ github.token }} |
GitHub Token used to authenticate API requests. Why? |
body |
✅ | — | The content to insert between delimiters in the target file. |
trim_whitespace |
❌ | true |
Trim leading and trailing whitespace in body . |
path |
✅ | — | File path to be modified. |
branch |
❌ | ${{ github.ref_name }} |
Branch to commit changes to. |
ref |
❌ | Default branch (usually master ) |
The target commit, branch, or tag. |
overwrite |
❌ | false |
Whether to overwrite the entire file. |
sync_local_file |
❌ | true |
Whether to sync the file from the local content. |
message |
❌ | doc: update <file path>. |
Commit message. |
committer_name |
❌ | github-actions[bot] |
Name used for the Git commit author. |
committer_email |
❌ | github-actions[bot]@users.noreply.github.com |
Email used for the Git commit author. |
openDelimiter |
❌ | <!--GAMFC-->2025-05-12 17:12:55<!--GAMFC-END--> |
End delimiter for content replacement. |
content
text file content- name: Modify README.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
path: README.md
README.md
file content
update time <!--GAMFC-->2025-05-12 17:12:55<!--GAMFC-END-->
Replace the content between <!--GAMFC-->2025-05-12 17:12:55<!--GAMFC-END-->
.
- name: Modify README.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
path: README.md
body: "{{date:YYYY-MM-DD HH:mm:ss}}"
- name: Modify README.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
path: README.md
body: "overwrite file content {{date:YYYY-MM-DD HH:mm:ss}}",
overwrite: 'true'
- name: Modify test test/overwrite.file.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
branch: test
path: test/overwrite.file.md
body: "{{date:YYYY-MM-DD HH:mm:ss}}"
overwrite: 'true'
package.json
.As always, thanks to our amazing contributors!
Licensed under the MIT License.