top

Modify File Content

Buy me a coffee test

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)

Inputs

Outputs

Example Usage

- 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-->.

format date

- name: Modify README.md
  uses: jaywcjlove/github-action-modify-file-content@main
  with:
    path: README.md
    body: "{{date:YYYY-MM-DD HH:mm:ss}}"

overwrite file

- 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'

specify branch changes

- 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'

See Also

License

Licensed under the MIT License.