Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Latest commit

 

History

241 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using my app is also a way to support me:
Scap: Screenshot & Markup Edit Screen Test Deskmark Keyzer Vidwall Hub VidCrop Vidwall Mousio Hint Mousio Musicer Audioer FileSentinel FocusCursor Videoer KeyClicker DayBar Iconed Menuist Quick RSS Quick RSS Web Serve Copybook Generator DevTutor for SwiftUI RegexMate Time Passage Iconize Folder Textsound Saver Create Custom Symbols DevHub Resume Revise Palette Genius Symbol Scribe

Modify File Content

Buy me a coffee Follow On X test

Replace text content and submit content

Here is the example: update time 2026-04-21 09:30:46

Here is the different delimiter example: different GAMFC_TABEL & GAMFC_TABEL-END (test)

Inputs

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-->2026-04-21 09:30:46<!--GAMFC-END--> End delimiter for content replacement.

Outputs

  • content text file content

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-->2026-04-21 09:30:46<!--GAMFC-END-->

Replace the content between <!--GAMFC-->2026-04-21 09:30:46<!--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

Contributors

As always, thanks to our amazing contributors!

小弟调调

License

Licensed under the MIT License.

About

Replace text content and submit content

Topics

Resources

Stars

16 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages