{"id":20000293,"url":"https://github.com/andstor/copycat-action","last_synced_at":"2025-04-09T16:20:30.967Z","repository":{"id":48281872,"uuid":"194508097","full_name":"andstor/copycat-action","owner":"andstor","description":":copyright::octocat: GitHub Action for copying files to other repositories","archived":false,"fork":false,"pushed_at":"2022-09-15T10:40:38.000Z","size":498,"stargazers_count":101,"open_issues_count":18,"forks_count":37,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-01T15:12:40.479Z","etag":null,"topics":["copy","deployment","github-action","publishing","synchronization"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/copycat-action","language":"Shell","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/andstor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-06-30T11:27:06.000Z","updated_at":"2024-03-27T07:30:18.000Z","dependencies_parsed_at":"2023-01-04T12:29:20.627Z","dependency_job_id":null,"html_url":"https://github.com/andstor/copycat-action","commit_stats":{"total_commits":122,"total_committers":7,"mean_commits":"17.428571428571427","dds":"0.17213114754098358","last_synced_commit":"c2b0316e9ab883478a4a7d40a4fcb03d17f281aa"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andstor%2Fcopycat-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andstor%2Fcopycat-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andstor%2Fcopycat-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andstor%2Fcopycat-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andstor","download_url":"https://codeload.github.com/andstor/copycat-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"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":["copy","deployment","github-action","publishing","synchronization"],"created_at":"2024-11-13T05:14:21.623Z","updated_at":"2025-04-09T16:20:30.944Z","avatar_url":"https://github.com/andstor.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=center\u003e\n\t\u003cimg width=\"240\" src=\"media/logo.svg\" alt=\"Copycat Logo\"\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eCOPYCAT\u003c/h1\u003e\n\n\u003e GitHub Action for copying files to other repositories.\n\nThis is a [GitHub action](https://developer.github.com/actions/) to copy files from your repository to another external repository. It is also possible to copy files from/to repository Wikis.\n\nThis action runs in a Docker container and therefore only supports Linux.\n\n## Usage\n\nThe following example [workflow step](https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow) will copy all files from the repository running the action, to a folder named `backup` in the destination repo `copycat-action`. If the files already exist at the destination repo, they will be overwritten.\n\n```yml\n- name: Copy\n  uses: andstor/copycat-action@v3\n  with:\n    personal_token: ${{ secrets.PERSONAL_TOKEN }}\n    src_path: /.\n    dst_path: /backup/\n    dst_owner: andstor\n    dst_repo_name: copycat-action\n```\n\n## Options ⚙️\n\nThe following input variable options can/must be configured:\n\n|Input variable|Necessity|Description|Default|\n|--------------------|--------|-----------|-------|\n|`src_path`|Required|The source path to the file(s) or folder(s) to copy from. For example `/.` or `path/to/home.md`.||\n|`dst_path`|Optional|The destination path to copy the file(s) or folder(s) to. For example `/wiki/` or `path/to/index.md`. |`src_path`|\n|`dst_owner`|Required|The name of the owner of the repository to push to. For example `andstor`.||\n|`dst_repo_name`|Required|The name of the repository to push to. For example `copycat-action`.||\n|`src_branch`|Optional|The name of the branch in source repository to clone from.|`master`|\n|`dst_branch`|Optional|The name of the branch in the destination repository to push to. If the branch doesn't exists, the branch will be created based on the default branch.|`master`|\n|`clean`|Optional|Set to `true` if the `dst_path` should be emptied before copying.|`false`|\n|`file_filter`|Optional|A simple [pattern](https://www.gnu.org/software/findutils/manual/html_mono/find.html#Shell-Pattern-Matching) for filtering files to be copied. Acts on file basename. For example `*.sh`.||\n|`filter`|Optional|A glob pattern for filtering files to be copied. Acts on file paths. For example `**/!(*.*)`.||\n|`exclude`|Optional|A glob pattern for excluding paths. For example `*/tests/*`.||\n|`src_wiki`|Optional|Set to `true` if the source repository you want to copy from is the GitHub Wiki.| `false`|\n|`dst_wiki`|Optional|Set to `true` if the destination repository you want to copy from is the GitHub Wiki.|`false`|\n|`commit_message`|Optional|A custom git commit message.||\n|`username`|Optional|The GitHub username to associate commits made by this GitHub action.|[`GITHUB_ACTOR`](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables)|\n|`email`|Optional|The email used for associating commits made by this GitHub action.|[`GITHUB_ACTOR`](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables) `@users.noreply.github.com`|\n\n## Secrets\n\n* `personal_token`: (required) GitHub Private Access Token used for the clone/push operations. To create it follow the [GitHub Documentation](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line).\n\n## Filtering\nCopycat provides several ways of filtering which files you want to copy.  \nAll three types of filtering can be applied simultaneously.\n\n### Input variables\n#### `file_filter`\nThe `file_filter`input variable allows you to filter file basenames. Hence, you can for example only copy all text files by setting `file_filter`to `*.txt`. The variable only accepts simple [patterns](https://www.gnu.org/software/findutils/manual/html_mono/find.html#Shell-Pattern-Matching).\n\n#### `filter`\nThe `filter` input variable provides extensive globbing support. It also supports extended globbing and globstar. The globbing applies to file paths. So, to for example match all files that doesn't have a file extention, the pattern could look like `**/!(*.*)`.\n\n#### `exclude`\nThe `exclude` input variable can be used to exclude certain paths. It will apply to the file paths. One are for example able to exclude certain deirectory names. Setting `exclude` to `*/tests/*` results in only copying files that don't lie inside a folder named `tests` (both directly and indirectly). Here, a file with for example the path `foo/tests/bar/baz.txt` would not be copied over.\n\n## Examples\n\n### Copy wiki files to external repo\n\nThis workflow configuration will copy all files from the repository's wiki to a folder named `wiki` in the destination repo `andstor.github.io`.\n\nThis can for example be used to merge several wikies of an organisation, and display them on a custom GitHub Pages site. The Jekyll theme [Paper](https://github.com/andstor/jekyll-theme-paper) has support for this.\n\n```yml\nname: Copy\non: gollum\njobs:\n  copy:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Copycat\n      uses: andstor/copycat-action@v3\n      with:\n        personal_token: ${{ secrets.PERSONAL_TOKEN }}\n        src_path: /.\n        dst_path: /wiki/\n        dst_owner: andstor\n        dst_repo_name: andstor.github.io\n        dst_branch: master\n        src_branch: master\n        src_wiki: true\n        dst_wiki: false\n        username: nutsbot\n        email: andr3.storhaug+bot@gmail.com\n```\n\n## Author\n\nThe Copycat GitHub action is written by [André Storhaug](https://github.com/andstor) \u003candr3.storhaug@gmail.com\u003e\n\n## License\n\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandstor%2Fcopycat-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandstor%2Fcopycat-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandstor%2Fcopycat-action/lists"}