{"id":13584928,"url":"https://github.com/windmill-labs/windmill-sync-example","last_synced_at":"2025-08-04T03:32:37.725Z","repository":{"id":65383275,"uuid":"589470257","full_name":"windmill-labs/windmill-sync-example","owner":"windmill-labs","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-20T02:17:56.000Z","size":796,"stargazers_count":31,"open_issues_count":56,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-28T21:43:40.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/windmill-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2023-01-16T07:39:50.000Z","updated_at":"2025-02-20T15:43:29.000Z","dependencies_parsed_at":"2024-01-05T17:48:06.399Z","dependency_job_id":"710911c9-a780-4a3a-8b0f-1cdc1b4125c3","html_url":"https://github.com/windmill-labs/windmill-sync-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/windmill-labs/windmill-sync-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windmill-labs%2Fwindmill-sync-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windmill-labs%2Fwindmill-sync-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windmill-labs%2Fwindmill-sync-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windmill-labs%2Fwindmill-sync-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windmill-labs","download_url":"https://codeload.github.com/windmill-labs/windmill-sync-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windmill-labs%2Fwindmill-sync-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268644311,"owners_count":24283334,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T15:04:36.453Z","updated_at":"2025-08-04T03:32:37.672Z","avatar_url":"https://github.com/windmill-labs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","others"],"sub_categories":[],"readme":"# Windmill Sync Example\n\nExample repo that demonstrate how to leverage Github to orchestrate your\ndevelopment cycles with Windmill.\n\n## How it works\n\nThis repo illustrates the following process:\n\n- Users iterates and make their changes in a \"staging\" Windmill workspace,\n  called `github-sync-example-staging` for this tutorial\n- Everytime a Windmill App, Flow or Script is deployed to that workspace (via\n  Windmill's UI), Windmill automatically commits it to this repo and creates one\n  branch per app/flow/script.\n- On every commit, PRs are automatically created via a Github action. Approved\n  Github users can review and merge those PRs.\n- Everytime a PR is merged, another Github action automatically deploys the\n  change to a \"production\" Windmill workspace, called `github-sync-example-prod`\n  for this tutorial\n\n## Setup\n\n#### Github repository setup\n\nFirst the Github repo needs to be setup and Windmill needs to be able to commit\nto it.\n\n1. Create a Github repository\n1. Generate a\n   [Github token with write permission](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token)\n   to this repository. This is necessary for Windmill to push commits to the\n   repo everytime a change is made to the staging workspase. (keep the token\n   value somewhere, we will need it in the following setup steps)\n1. In the repository settings \u003e Actions \u003e General, tick the\n   [Allow GitHub Actions to create and approve pull requests](https://docs.github.com/en/enterprise-server@3.10/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests).\n   This is necessary for the Github action automatically creating PRs when\n   Windmill commits a change\n1. From Windmill, create a token under User settings \u003e Token and\n   [save it as a secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)\n   named `WMILL_TOKEN` in the repo settings \u003e \"Secret and Variable\" \u003e \"Actions\".\n   This is necessary for Windmill to push to the production workspace\n   ![](./img/token_creation.png)\n\n#### Windmill setup\n\n1. In Windmill, create a `git_repository` resource pointing to the Github\n   repository and containing the token generated previously. You URL should be\n   `https://[USERNAME]:[TOKEN]@github.com/[ORG|USER]/[REPO_NAME].git`. Note that\n   you have the possibility to input a custom branch name and a subfolder in\n   this resource. Given that we are going to request Windmill to create one\n   branch per script/flow/app, setting a custom branch will have no effect.\n   However, if you wish to persist the windmill workspace in a subfolder of your\n   repository, you can set it here. ![](./img/resource_creation.png)\n1. In Windmill workspace settings \u003e Git sync tab, pick the `git_repository`\n   resource and toggle ON \"Create one branch per per deployed script/flow/app\"\n   ![](./img/git_sync_tab.png)\n\n#### Github actions setup\n\nTwo actions are needed.\n\n1. The first one to automatically create a PR when Windmill commits a change\n   after a user deployed a script/flow/app in the staging workspace. It is\n   [open-pr-on-commit.yaml](./.github/workflows/open-pr-on-commit.yaml). All\n   branches created by Windmill will have a `wm_deploy/` prefix, which is handy\n   to triger this action only when a branch mathcing this pattern is created.\n1. The second one to automatically push the content of the repo to the Windmill\n   production workspace when a PR is merged. It is\n   [push-on-merge.yaml](./.github/workflows/push-on-merge.yaml). This action\n   uses the [Github CLI](https://cli.github.com/) which is available by default\n   on Github action workers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindmill-labs%2Fwindmill-sync-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindmill-labs%2Fwindmill-sync-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindmill-labs%2Fwindmill-sync-example/lists"}