{"id":15860371,"url":"https://github.com/suzuki-shunsuke/simple-sync-action","last_synced_at":"2025-04-15T23:09:45.958Z","repository":{"id":220740797,"uuid":"752470308","full_name":"suzuki-shunsuke/simple-sync-action","owner":"suzuki-shunsuke","description":"GitHub Actions to synchronize specific files with the specific branch to prevent tamper","archived":false,"fork":false,"pushed_at":"2024-12-25T03:14:40.000Z","size":25,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-25T04:18:53.127Z","etag":null,"topics":["github-actions","oss","security"],"latest_commit_sha":null,"homepage":"","language":null,"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/suzuki-shunsuke.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-03T23:41:55.000Z","updated_at":"2024-12-25T03:14:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"829c1d9f-6c65-47b8-a508-15b9df56a9bd","html_url":"https://github.com/suzuki-shunsuke/simple-sync-action","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":0.3157894736842105,"last_synced_commit":"3d31d6002613e4f0880b76c91d20f540ad284650"},"previous_names":["suzuki-shunsuke/simple-sync-action"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suzuki-shunsuke%2Fsimple-sync-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suzuki-shunsuke%2Fsimple-sync-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suzuki-shunsuke%2Fsimple-sync-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suzuki-shunsuke%2Fsimple-sync-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suzuki-shunsuke","download_url":"https://codeload.github.com/suzuki-shunsuke/simple-sync-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237651177,"owners_count":19344670,"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":["github-actions","oss","security"],"created_at":"2024-10-05T22:00:21.222Z","updated_at":"2025-02-07T13:17:19.142Z","avatar_url":"https://github.com/suzuki-shunsuke.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-sync-action\n\nGitHub Actions to synchronize specific files with the specific branch to prevent tamper\n\nThis action is useful for the security of CI.\n\n[action.yaml](action.yaml)\n\n## Motivation\n\nCI has security threats that attackers tamper files and execute malicious codes.\nFor example, if you execute shell scripts in CI via pull request event, attackers can tamper files in pull requests and execute malicious codes in CI.\nSo you should prevent these files from being tampered without any review.\n\nThis action synchronizes files with the given branch, basically this would be the default branch.\nSo even if attackers tamer files in pull requests, you can prevent them from being executed without any review.\n\n## :bulb: Prevent workflows from being tampered by `pull_request_target` event\n\nEven if you use this action, it's meaningless if attackers can tamper workflows.\nTo prevent it, you should consider using `pull_request_target` event instead of `pull_request` event.\n\nPlease see [Secure GitHub Actions by pull_request_target](https://dev.to/suzukishunsuke/secure-github-actions-by-pullrequesttarget-641) too.\n\n## How to use\n\ne.g.\n\n```yaml\n---\nname: test\non: pull_request_target\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1\n      - uses: suzuki-shunsuke/simple-sync-action@ed6c2035e78b5bd43ae8167446f00755692ca06c # v0.1.0\n        with:\n          files: |\n            # The list of synchronized files and directories\n            # comment\n            # empty lines are ignored\n\n            # Prevent malicious codes from being executed in CI\n            Makefile\n            scripts\n      - run: make test\n```\n\n## Requirements\n\n- bash\n- rsync\n\n## What does this action do?\n\n1. Clone the given branch temporarily\n2. Synchronize give files by rsync\n3. Remove the cloned repository\n\n## Inputs\n\n- `files`: (Required) The list of synchronized files and directories. Empty lines and lines starting with `#` are ignored.\n\n\u003e [!WARNING]\n\u003e The action fails if `files` don't exist on the `ref`.\n\n- `ref`: (Optional) The base ref. The default value is `main`\n\n## Outputs\n\nNothing.\n\n## LICENSE\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuzuki-shunsuke%2Fsimple-sync-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuzuki-shunsuke%2Fsimple-sync-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuzuki-shunsuke%2Fsimple-sync-action/lists"}