{"id":22350182,"url":"https://github.com/planetoftheweb/copy-to-branches","last_synced_at":"2025-09-11T16:11:01.048Z","repository":{"id":48460103,"uuid":"325914500","full_name":"planetoftheweb/copy-to-branches","owner":"planetoftheweb","description":"Copies files from any 'key' branch to all other branches. By default, LICENSE, NOTICE and README.md will be copied from the main/master branch to all branches, but it can be configured so you can specify a list of branches, a list of files or branches to exclude from all branches.","archived":false,"fork":false,"pushed_at":"2023-03-29T00:23:55.000Z","size":32,"stargazers_count":16,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-29T11:49:01.296Z","etag":null,"topics":["actions","alpine","bash","branches-workflow","github","shell","utility","workflow"],"latest_commit_sha":null,"homepage":"","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/planetoftheweb.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":"2021-01-01T04:10:26.000Z","updated_at":"2024-10-11T08:17:09.000Z","dependencies_parsed_at":"2024-06-18T22:36:03.554Z","dependency_job_id":"8fb1c427-c917-4558-b348-e64c48eb2595","html_url":"https://github.com/planetoftheweb/copy-to-branches","commit_stats":{"total_commits":56,"total_committers":2,"mean_commits":28.0,"dds":"0.017857142857142905","last_synced_commit":"483d037fe2d6771bf5217f703d6e6d471594eca3"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetoftheweb%2Fcopy-to-branches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetoftheweb%2Fcopy-to-branches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetoftheweb%2Fcopy-to-branches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetoftheweb%2Fcopy-to-branches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planetoftheweb","download_url":"https://codeload.github.com/planetoftheweb/copy-to-branches/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228098282,"owners_count":17869033,"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","alpine","bash","branches-workflow","github","shell","utility","workflow"],"created_at":"2024-12-04T11:10:35.038Z","updated_at":"2024-12-04T11:10:35.661Z","avatar_url":"https://github.com/planetoftheweb.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Copy To Branches Action/Shell Script\n\nThis action runs a shell script `entrypoint.sh` file which lets you copy one or more files from a **key** branch to any other branches in your repo. By default, it copies the following files\n\n- `LICENSE`\n- `NOTICE`\n- `README.md`\n- `CONTRIBUTING.md`\n- `./vscode/settings.json`\n- `.devcontainer/devcontainer.json`\n- `.github/CODEOWNERS`\n- `.github/ISSUE_TEMPLATE.MD`\n- `.github/PULL_REQUEST_TEMPLATE.MD`\n- `.github/workflows/main.yml`\n\nFrom the main/master branch to all branches on repository.\n\n# Running this action\n1. Go to your repo\n2. Click on the **Actions** tab\n\n![Click on Actions Tab](http://pixelprowess.com/i/2021-01-07_01-38-46.png)\n\n3. Click on the **Set up a workflow yourself** link\n\n![Set up a workflow yourself link](http://pixelprowess.com/i/2021-01-07_01-39-53.png)\n\n4. Use the following script.\n\n```yaml\nname: Copy To Branches\non:\n  workflow_dispatch:\njobs:\n  copy-to-branches:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n      - name: Copy To Branches Action\n        uses: planetoftheweb/copy-to-branches@v1.2\n        env:\n          key: main\n```\n\n5. Click the **Start commit** button\n\n![Start Commit Button](http://pixelprowess.com/i/2021-01-07_01-49-18.png)\n\n6. Click back on the **Actions** tab\n7. Click on the **Copy To Branches** workflow\n8. Click on **Run Workflow**\n\n![](http://pixelprowess.com/i/2021-01-07_01-52-54.png)\n\nThe workflow should run automatically, you can monitor it if you want to.\n\n# Optional Arguments\n\n\nBy default, the action will try to copy the  **LICENSE**, **NOTICE** and **README.md** files from the `main` branch to all branches, but you can modify the behavior by adding a list of arguments in an `env` variable.\n## Example\n\n```yaml\nname: Copy To Branches\non:\n  workflow_dispatch:\njobs:\n  copy-to-branches:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n      - name: Copy To Branches Action\n        uses: planetoftheweb/copy-to-branches@v1\n        env:\n          key: main\n          exclude: work 99_target\n          files: README.md\n```\n\nUsing the key branch named `main` This will copy only the `README.md` file to all branches, but skip two branches, one named `work` and one called `99_target`.\n\n## Key\nThis is the key branch that you're using as the origin, in other words, the branch you want to copy from. By default, you should include `main`, but you can ask for a different branch to copy from. Say you wanted to copy files from the branch named `02_03b` to all branches. You would use:\n\n```yaml\nenv:\n  key: 02_03b\n```\n\n## Files to copy\nBy default, the script assumes you want to copy the `LICENSE`, `NOTICE` and `README.md` files. If you want to change this, you can pass along a different list of files to use instead. Use the `files` keyword and then pass a list of one or more branches separated by spaces.\n\n```yaml\nenv:\n  files: README.md NOTICE\n```\n\n## Branches to Copy\nBy default, the script assumes you want to copy the files to all the branches in the repo. If you want to copy the files to only certain branches, then you can include this option.\n\n```yaml\nenv:\n  branches: 02_03b 02_03e 02_04b\n  key: main\n```\n\n:warning: When you add a custom branch list, if you don't include a `main` or `master` branch in your list, the script wont run because it won't have a key branch to copy to.\n\nYou can easily add a key branch with the `key` option.\n\n## Branches to Exclude\nBy default, the script will copy the files to all branches. You can exclude one or more branches by creating a list of branches to exclude.\n\n```yaml\nenv:\n  exclude: target gh-pages\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetoftheweb%2Fcopy-to-branches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanetoftheweb%2Fcopy-to-branches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetoftheweb%2Fcopy-to-branches/lists"}