{"id":26945795,"url":"https://github.com/metrisk/template-updater","last_synced_at":"2026-05-10T02:54:19.889Z","repository":{"id":37806214,"uuid":"342275634","full_name":"metrisk/template-updater","owner":"metrisk","description":"Github Action to update child repos of template repositories","archived":false,"fork":false,"pushed_at":"2023-01-26T12:02:54.000Z","size":441,"stargazers_count":3,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-22T04:32:28.378Z","etag":null,"topics":["bash","github-actions","templates"],"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/metrisk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-25T14:43:20.000Z","updated_at":"2022-11-05T06:11:50.000Z","dependencies_parsed_at":"2023-02-16T05:45:24.814Z","dependency_job_id":null,"html_url":"https://github.com/metrisk/template-updater","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":0.4666666666666667,"last_synced_commit":"b1d23180d11b27d5377d6819dd7a48275cdbb39b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metrisk%2Ftemplate-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metrisk%2Ftemplate-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metrisk%2Ftemplate-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metrisk%2Ftemplate-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metrisk","download_url":"https://codeload.github.com/metrisk/template-updater/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246875872,"owners_count":20848049,"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":["bash","github-actions","templates"],"created_at":"2025-04-02T19:16:20.810Z","updated_at":"2026-05-10T02:54:19.821Z","avatar_url":"https://github.com/metrisk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# template-updater\n\n[Github template repositories](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-template-repository) are great for creating base config repos for the whole of your organisation but what happens when that base config changes?\n\nThe usual way to keep your repositories up to date with each other would be to add the template repository as a 'upstream' remote, similar to if you had forked it.\n\nThis is manual, it's easy to forget to do it, or even not know that you should do it.\n\nThis Action will automatically update the files you require from the template repository, so you could set up a cron workflow to check daily/weekly/monthly if your repo has new ESLint/Rubocop/whatever rules to follow.\n\n## Usage\n\nA simple example of how to use this action is shown below.\n\n```yml\nname: Update Template Config\non:\n  schedule:\n    - cron: \"00 08 * * 1-5\"\njobs:\n  updatetypescripttemplate:\n    name: Update config from template\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2.3.4\n      - uses: metrisk/template-updater@main\n        with:\n          template_repo: \"your-org/typescript-template\"\n          files_to_update: .github/workflows/update_template_files.yml,.github/workflows/update_docs.yml\n        env:\n          PRIVATE_KEY: ${{ secrets.PRIVATE_SSH_KEY }}\n```\n\nThe full list of inputs are as follows:\n\n`template_repo`: The name of the template repository, e.g. 'your-org/super-template'\n\n`files_to_update`: The files you want to update from the template repository as a comma delimited string\n\n`username`: The name of the user who will be making the changes. e.g. 'Wade Wilson'\n\n`email`: The email address for the user making the changes. 'wade@unicorn.love'\n\n`branch_name`: (optional) The branch name where you would like the changes to be pushed to. The default is `update-template-settings`\n\nThe required environment variable is:\n\n`PRIVATE_KEY`: This is the private SSH key for the user who is making the changes. This **must** match the email provided and **must** be the private key match to a public key in the users Github settings.\n\nThe reason for the action needing this key is excellently explained [here](https://www.webfactory.de/blog/use-ssh-key-for-private-repositories-in-github-actions).\n\nThe output is a boolean value named: `updated`\n\n## How it works\n\nThe core of the action is the [updater](./scripts/updater.sh) bash script.\n\nThe flow is:\n\n1. Check that the repository running the action isn't the same as the template repository. Fail if it is.\n2. Setup SSH - i.e. add the private key to `ssh-agent`\n3. Configure Git with the provided name/email\n4. Adds the template repository as the upstream remote\n5. Fetches the `main` branch from the template repository\n6. Checks for the branch name provided, if it exists switch to that branch, else stay on `main`\n7. Checks each file you have supplied to see if there is a diff between your repo and the template. If there is a diff, then it performs the update, otherwise the Action finishes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetrisk%2Ftemplate-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetrisk%2Ftemplate-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetrisk%2Ftemplate-updater/lists"}