{"id":26218183,"url":"https://github.com/nambers/replacestringinfile","last_synced_at":"2026-07-03T01:33:51.213Z","repository":{"id":65158256,"uuid":"553605249","full_name":"Nambers/ReplaceStringInFile","owner":"Nambers","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-03T20:41:47.000Z","size":675,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T13:38:45.813Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Nambers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-18T13:26:10.000Z","updated_at":"2022-10-18T16:12:23.000Z","dependencies_parsed_at":"2023-01-13T15:43:17.156Z","dependency_job_id":null,"html_url":"https://github.com/Nambers/ReplaceStringInFile","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"b365c6051fd5c3a539b8659f7157908ee0f25569"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":"actions/hello-world-javascript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nambers%2FReplaceStringInFile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nambers%2FReplaceStringInFile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nambers%2FReplaceStringInFile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nambers%2FReplaceStringInFile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nambers","download_url":"https://codeload.github.com/Nambers/ReplaceStringInFile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243222181,"owners_count":20256229,"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":[],"created_at":"2025-03-12T13:15:48.368Z","updated_at":"2025-10-26T10:19:03.366Z","avatar_url":"https://github.com/Nambers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReplaceStringInFile action\n[![.github/workflows/test.yaml](https://github.com/Nambers/ReplaceStringInFile/actions/workflows/test.yaml/badge.svg)](https://github.com/Nambers/ReplaceStringInFile/actions/workflows/test.yaml)\nThis action replace string in file.  \nIt works on both Linux and Windows.  \n\nThis action uses `sed` in Linux and `powershell shell code` in Windows to replace.\n\n## Inputs\n\n### `path`\nThe path of the file.  \n**Required**.  \n\n### `oldString`\nGeneral `oldString` regex used both in Linux and Windows.\n**Required**.  \n\n### `oldStringWin`\n`oldString` regex used in Windows OS. If this exist, action will use this one instead of general `oldString`.  \n\n### `oldStringLinux`\n`oldString` regex used in Linux OS. If this exist, action will use this one instead of general `oldString`.  \n\n### `newString`\nGeneral `newString` used both in Linux and Windows.  \n**Required** Default ''.  \n\n### `newStringWin`\n`newString` used in Windows OS. If this exist, action will use this one instead of general `newString`.  \nDefault: 'nullForStringInAction'.  \n\n### `newStringLinux`\n`newString` used in Linux OS. If this exist, action will use this one instead of general `newString`.  \nDefault: 'nullForStringInAction'.  \n\n### `regexOptions`\nRegex options.  \nDefault: 'g'.  \n\n### `escapeBackslash`\nEscape backslash ( \\ -\u003e \\\\\\ in win and \\ -\u003e / ).  \nDefault: false  \n\n### `showFileContent`\nIf it equal to ture, action will print out file content after replacement finished.\n\nAction uses `cat` in Linux and `type` in Windows to print.\n\nDefault: false.\n\n## Example usage\n[test.yaml](.github/workflows/test.yaml)\n```yaml\n- name: replace\n  uses: Nambers/ReplaceStringInFile@v1\n  with:\n    path: ${{ github.workspace }}/a.test\n    oldString: abc123))\n    oldStringWin: abc123\\)\\)\n    newString: --_\n    showFileContent: true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnambers%2Freplacestringinfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnambers%2Freplacestringinfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnambers%2Freplacestringinfile/lists"}