{"id":14985876,"url":"https://github.com/hunghg255/action-modify-file","last_synced_at":"2025-04-11T22:11:52.990Z","repository":{"id":255297247,"uuid":"849151100","full_name":"hunghg255/action-modify-file","owner":"hunghg255","description":"Action Modify File ","archived":false,"fork":false,"pushed_at":"2024-08-29T05:17:28.000Z","size":201,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T22:11:47.405Z","etag":null,"topics":["actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hunghg255.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T04:27:05.000Z","updated_at":"2024-10-07T02:24:07.000Z","dependencies_parsed_at":"2024-08-29T05:52:26.959Z","dependency_job_id":null,"html_url":"https://github.com/hunghg255/action-modify-file","commit_stats":null,"previous_names":["hunghg255/action-modify-file"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Faction-modify-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Faction-modify-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Faction-modify-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Faction-modify-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hunghg255","download_url":"https://codeload.github.com/hunghg255/action-modify-file/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487691,"owners_count":21112190,"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"],"created_at":"2024-09-24T14:11:49.066Z","updated_at":"2025-04-11T22:11:52.954Z","avatar_url":"https://github.com/hunghg255.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/action-modify-file\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n\u003cimg src=\"https://api.iconify.design/simple-icons:githubactions.svg?color=%23cefdb4\" alt=\"logo\" width='100'/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  A Github actions to modify files in a repository.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/hunghg255/action-modify-file/graphs/contributors\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://img.shields.io/badge/all_contributors-1-orange.svg\" alt=\"Contributors\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/hunghg255/action-modify-file/blob/main/LICENSE\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://badgen.net/github/license/hunghg255/action-modify-file\" alt=\"License\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Usage\n\n## Inputs\n\n### `path`\n\n**Required** The path to the file to write.\n\n### `contents`\n\n**Required** The contents of the file.\n\n### `mode`\n\n**Optional** The mode of writing to use: `overwrite`, `append`, or `preserve`.\n\nModes:\n\n- `overwrite` - overwrite the file if it exists\n- `append` - if the file exists, it will be appended to\n- `preserve` - if the file already exists the contents will not be written to\n\n**Default** `append`\n\n## Outputs\n\n### `size`\n\nReturns the file size.\n\n## Example usage\n\n```yaml\nuses: hunghg255/action-modify-file@main\nwith:\n  path: ${{ env.home}}/.bashrc\n  contents: |\n    Hello World!\n  mode: append\n```\n\n## Example usage with checkout, commit and push\n\n```yaml\nname: Overwrite some file\n\non:\n  push:\n    branches: [main]\n  workflow_dispatch:\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v3\n\n      - name: Overwrite file\n        uses: 'hunghg255/action-modify-file@main'\n        with:\n          path: path/to/file.js\n          mode: overwrite\n          contents: |\n            console.log('some contents')\n\n      - name: Commit \u0026 Push\n        uses: Andro999b/push@v1.3\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          branch: main\n          force: true\n          message: 'Overwritten by Github Actions - ${date}'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunghg255%2Faction-modify-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunghg255%2Faction-modify-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunghg255%2Faction-modify-file/lists"}