{"id":15678003,"url":"https://github.com/jaywcjlove/github-action-modify-file-content","last_synced_at":"2025-05-07T01:48:45.595Z","repository":{"id":62137820,"uuid":"557814634","full_name":"jaywcjlove/github-action-modify-file-content","owner":"jaywcjlove","description":"Replace text content and submit content","archived":false,"fork":false,"pushed_at":"2024-03-07T17:17:55.000Z","size":1464,"stargazers_count":12,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-15T07:22:55.883Z","etag":null,"topics":["actions","github-actions","github-api"],"latest_commit_sha":null,"homepage":"https://jaywcjlove.github.io/github-action-modify-file-content","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaywcjlove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"custom":"https://jaywcjlove.github.io/#/sponsor"}},"created_at":"2022-10-26T11:01:56.000Z","updated_at":"2024-05-12T07:00:10.717Z","dependencies_parsed_at":"2022-10-27T04:00:37.238Z","dependency_job_id":"2ab93e0f-3227-47a0-a983-72060ed333cc","html_url":"https://github.com/jaywcjlove/github-action-modify-file-content","commit_stats":{"total_commits":182,"total_committers":4,"mean_commits":45.5,"dds":0.478021978021978,"last_synced_commit":"9245118dbc6ba2392922c8c248e6e89e13955426"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fgithub-action-modify-file-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fgithub-action-modify-file-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fgithub-action-modify-file-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fgithub-action-modify-file-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaywcjlove","download_url":"https://codeload.github.com/jaywcjlove/github-action-modify-file-content/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242756828,"owners_count":20180199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","github-actions","github-api"],"created_at":"2024-10-03T16:14:53.184Z","updated_at":"2025-03-10T16:31:28.725Z","avatar_url":"https://github.com/jaywcjlove.png","language":"TypeScript","funding_links":["https://jaywcjlove.github.io/#/sponsor"],"categories":[],"sub_categories":[],"readme":"Modify File Content\n===\n\n[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)\n[![test](https://github.com/jaywcjlove/github-action-modify-file-content/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/github-action-modify-file-content/actions/workflows/ci.yml)\n\nReplace text content and submit content\n\nHere is the example: update time \u003c!--GAMFC--\u003e2024-06-25 15:56:51\u003c!--GAMFC-END--\u003e\n\nHere is the different delimiter example: \u003c!--GAMFC_TABEL--\u003edifferent `GAMFC_TABEL` \u0026 `GAMFC_TABEL-END` (test)\u003c!--GAMFC_TABEL-END--\u003e\n\n## Inputs\n\n- `token` Your `GITHUB_TOKEN`. This is required. Why do we need `token`? Read more here: [About the GITHUB_TOKEN secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret). Default: `${{ github.token }}`\n- `body` what needs to be replaced\n- `path` file to be replaced\n- `branch` The branch where the files are committed. Default: `${{ github.ref_name }}`\n- `ref` The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`)\n- `overwrite` Overwrite the entire file content, by default `false`\n- `sync_local_file` Sync local file content, by default `true`\n- `message` The commit message. by default `doc: update \u003cfile path\u003e.`\n- `committer_name` The name of the author or committer of the commit. by default `github-actions[bot]`\n- `committer_email` The email of the author or committer of the commit. by default `github-actions[bot]@users.noreply.github.com`\n- `openDelimiter` Character to use for opening delimiter, by default \"\u003c\\!--GAMFC--\u003e\"\n- `closeDelimiter` Character to use for closing delimiter, by default \"\u003c\\!--GAMFC-END--\u003e\"\n\n## Outputs\n\n- `content` text file content\n\n## Example Usage\n\n```yml\n- name: Modify README.md\n  uses: jaywcjlove/github-action-modify-file-content@main\n  with:\n    path: README.md\n```\n\n`README.md` file content\n\n```markdown\nupdate time \u003c!--GAMFC--\u003e2024-06-25 15:56:51\u003c!--GAMFC-END--\u003e\n```\n\nReplace the content between `\u003c!--GAMFC--\u003e2024-06-25 15:56:51\u003c!--GAMFC-END--\u003e`.\n\n### format date\n\n```yml\n- name: Modify README.md\n  uses: jaywcjlove/github-action-modify-file-content@main\n  with:\n    path: README.md\n    body: \"{{date:YYYY-MM-DD HH:mm:ss}}\"\n```\n\n### overwrite file\n\n```yml\n- name: Modify README.md\n  uses: jaywcjlove/github-action-modify-file-content@main\n  with:\n    path: README.md\n    body: \"overwrite file content {{date:YYYY-MM-DD HH:mm:ss}}\",\n    overwrite: 'true'\n```\n\n### specify branch changes\n\n```yml\n- name: Modify test test/overwrite.file.md\n  uses: jaywcjlove/github-action-modify-file-content@main\n  with:\n    branch: test\n    path: test/overwrite.file.md\n    body: \"{{date:YYYY-MM-DD HH:mm:ss}}\"\n    overwrite: 'true'\n```\n\n## See Also\n\n- [Github Release Changelog Generator](https://github.com/jaywcjlove/changelog-generator) A GitHub Action that compares the commit differences between two branches\n- [Create Tags From](https://github.com/jaywcjlove/create-tag-action) Auto create tags from commit or package.json.\n- [Github Action Contributors](https://github.com/jaywcjlove/github-action-contributors) Github action generates dynamic image URL for contributor list to display it!\n- [Generated Badges](https://github.com/jaywcjlove/generated-badges) Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers)\n- [Create Coverage Badges](https://github.com/jaywcjlove/coverage-badges-cli) Create coverage badges from coverage reports. (no 3rd parties servers)\n- [Github Action package](https://github.com/jaywcjlove/github-action-package) Read and modify the contents of `package.json`.\n- [Github Action EJS](https://github.com/jaywcjlove/github-action-package) A github action to render a ejs template using github context.\n- [Github Action Read File Content](https://github.com/jaywcjlove/github-action-read-file) \nRead file contents. You can also get the file content in the branch.\n\n## License\n\nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fgithub-action-modify-file-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaywcjlove%2Fgithub-action-modify-file-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fgithub-action-modify-file-content/lists"}