Replace text content and submit content
Here is the example: update time 2025-05-12 17:15:59
Here is the different delimiter example: differentGAMFC_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 inbody. |
path | ✅ | — | File path to be modified. |
branch | ❌ | ${{ github.ref_name }} | Branch to commit changes to. |
ref | ❌ | Default branch (usuallymaster) | 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:15:59<!--GAMFC-END--> | End delimiter for content replacement. |
content text file content-name: Modify README.mduses: jaywcjlove/github-action-modify-file-content@mainwith:path: README.mdREADME.md file content
update time<!--GAMFC-->2025-05-12 17:15:59<!--GAMFC-END-->Replace the content between<!--GAMFC-->2025-05-12 17:15:59<!--GAMFC-END-->.
-name: Modify README.mduses: jaywcjlove/github-action-modify-file-content@mainwith:path: README.mdbody:"{{date:YYYY-MM-DD HH:mm:ss}}"-name: Modify README.mduses: jaywcjlove/github-action-modify-file-content@mainwith:path: README.mdbody:"overwrite file content {{date:YYYY-MM-DD HH:mm:ss}}",overwrite:'true'-name: Modify test test/overwrite.file.mduses: jaywcjlove/github-action-modify-file-content@mainwith:branch: testpath: test/overwrite.file.mdbody:"{{date:YYYY-MM-DD HH:mm:ss}}"overwrite:'true'package.json.As always, thanks to our amazing contributors!
Licensed under the MIT License.