{"id":17383723,"url":"https://github.com/n3tuk/action-synchronise-upstream","last_synced_at":"2025-10-09T16:03:11.592Z","repository":{"id":166634157,"uuid":"642144443","full_name":"n3tuk/action-synchronise-upstream","owner":"n3tuk","description":"A GitHub Action to help synchronise changes to upstream template repositories to downstream copies.","archived":false,"fork":false,"pushed_at":"2024-09-19T17:18:26.000Z","size":52,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-08T09:03:38.921Z","etag":null,"topics":["bats","cookiecutter","cookiecutter-template","github-action","github-workflows","release-drafter","shell-scripts"],"latest_commit_sha":null,"homepage":null,"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/n3tuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-17T23:27:31.000Z","updated_at":"2024-11-23T23:20:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"17f83832-cda8-49b1-bcb0-2eb8ff04294d","html_url":"https://github.com/n3tuk/action-synchronise-upstream","commit_stats":null,"previous_names":["n3tuk/action-synchronise-upstream"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n3tuk%2Faction-synchronise-upstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n3tuk%2Faction-synchronise-upstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n3tuk%2Faction-synchronise-upstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n3tuk%2Faction-synchronise-upstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n3tuk","download_url":"https://codeload.github.com/n3tuk/action-synchronise-upstream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924515,"owners_count":20694730,"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":["bats","cookiecutter","cookiecutter-template","github-action","github-workflows","release-drafter","shell-scripts"],"created_at":"2024-10-16T07:43:36.680Z","updated_at":"2025-10-09T16:03:06.559Z","avatar_url":"https://github.com/n3tuk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# n3tuk Upstream Template Synchroniser\n\nA GitHub Action for running [`cookiecutter`][cookiecutter] from upstream\ntemplate repositories in the `n3tuk` Organisation and apply them over the\ntemplates repositories and submit any changes as a pull request for review and\nmerging.\n\n[cookiecutter]: https://github.com/cookiecutter/cookiecutter\n\n## Features\n\nThis GitHub Action provides the following features:\n\n- Merge upstream changes to the `cookiecutter.json` default configuration file\n  with the downstream `cookiecutter.json` configuration for each templated\n  repository, allowing new settings to be automatically added with the provided\n  default value.\n- Optionally re-render the upstream template files with the downstream\n  `cookiecutter.json` configuration (with updates, if updated) and apply over\n  the current repository files.\n- Allow the downstream repository to ignore upstream changes to selected files\n  with `.templateignore` in the root directory in the same format as\n  `.gitignore`. Follow the [glob pattern][glob-pattern] in defining the files\n  and folders that the action should excluded.\n- Add support for updates and removal of files inside the downstream repository\n  as configured inside the `cookiecutter.json` file, allowing easier migration\n  of existing files and removal of old files as part of standard updates.\n\n[glob-pattern]: https://en.wikipedia.org/wiki/Glob_(programming)\n\n## Upstream\n\nThe codebase for this GitHub Action is an update on the\n[`actions-template-sync`][actions-template-sync] GitHub Action, with handling of\ntemplated file overrides (ignores), merging of upstream and downstream\ncookiecutter configurations, and building the cookiecutter repository upstream\nand overlaying it downstream.\n\n[actions-template-sync]: https://github.com/AndreasAugustin/actions-template-sync\n\n## Usage\n\nYou can use the [synchronise-upstream GitHub\nAction][synchronise-upstream-marketplace] in a [GitHub\nWorkflow][github-workflow] by configuring a YAML file in your GitHub repository\n(under `.github/workflows/synchronise-upstream.yaml`), with the following contents:\n\n[github-workflow]: https://help.github.com/en/articles/about-github-actions\n[synchronise-upstream-marketplace]: https://github.com/marketplace/actions/synchronise-upstream\n\n```yaml\n---\nname: Synchronise Upstream\n\non:\n  # Run at 18:15 on Wednesdays\n  schedule:\n    - cron: \"15 18 * * 3\"\n  # Allow this GitHub Action to be manually triggered\n  workflow_dispatch:\n\npermissions:\n  contents: write\n  packages: read\n  issues: write\n  pull-requests: write\n\njobs:\n  template-sync:\n    name: Template Synchronise\n    runs-on: ubuntu-latest\n    env:\n      SYNCHRONISER_TOKEN: ${{ secrets.SYNCHRONISER_TOKEN || secrets.GITHUB_TOKEN } }\n    steps:\n      - name: Checkout the repository\n        uses: actions/checkout@v3\n        with:\n          token: ${{ env.SYNCHRONISER_TOKEN }}\n\n      - name: Render and synchronise the template repository\n        uses: n3tuk/action-synchronise-upstream@v1\n        with:\n          token: ${{ env.SYNCHRONISER_TOKEN }}\n          repository: n3tuk/template-terraform-module\n          labels: release/skip,dependencies\n```\n\n## Inputs\n\n| Variable     | Description                                                                                                                                                     | Required | Default                               |\n| :----------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | :------------------------------------ |\n| `token`      | The GitHub Token to fetch the template repository and to make changes against the local repository. This is typically set to `secrets.GITHUB_TOKEN`.            |  `true`  |                                       |\n| `repository` | The owner/name (i.e. n3tuk/template-terraform-module) of the GitHub repository used to provide the cookiecutter templates for this local repository.            |  `true`  |                                       |\n| `branch`     | The name of the branch to use in the GitHub repository used to provide the cookiecutter templates for the local repository.                                     | `false`  | `main`                                |\n| `target`     | The target branch of the local repository to raise the pull request against whem procesing for changes in the template repository or local configuration.       | `false`  | `main`                                |\n| `prefix`     | The prefix for the name of the pull request branch created by this GitHub Action when processing for changes in the template repository or local configuration. | `false`  | `chore/synchronise-upstream/`         |\n| `title`      | The title of the pull request set by this GitHub Action when processing for changes in the template repository or local configuration.                          | `false`  | Synchronise Upstream Template Changes |\n| `labels`     | A comma-separated list of pull request labels to add by this GitHub Action on any created pull request.                                                         | `false`  | `[]`                                  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn3tuk%2Faction-synchronise-upstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn3tuk%2Faction-synchronise-upstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn3tuk%2Faction-synchronise-upstream/lists"}