Replace text content and submit content
Here is the example: update time 2023-11-25 13:00:39
Here is the different delimiter example: different GAMFC_TABEL
& GAMFC_TABEL-END
(test)
token
Your GITHUB_TOKEN
. This is required. Why do we need token
? Read more here: About the GITHUB_TOKEN secret. Default: ${{ github.token }}
body
what needs to be replacedpath
file to be replacedbranch
The branch where the files are committed. Default: ${{ github.ref_name }}
ref
The name of the commit/branch/tag. Default: the repository’s default branch (usually master
)overwrite
Overwrite the entire file content, by default false
sync_local_file
Sync local file content, by default true
message
The commit message. by default doc: update <file path>.
committer_name
The name of the author or committer of the commit. by default github-actions[bot]
committer_email
The email of the author or committer of the commit. by default github-actions[bot]@users.noreply.github.com
openDelimiter
Character to use for opening delimiter, by default "<!--GAMFC-->"closeDelimiter
Character to use for closing delimiter, by default "<!--GAMFC-END-->"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-->2023-11-25 13:00:39<!--GAMFC-END-->
Replace the content between <!--GAMFC-->2023-11-25 13:00:39<!--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
.Licensed under the MIT License.