ConfigSync + GitHub Actions: Auto-Sync Configs on PR Merge
Use a GitHub Action to automatically push team configurations to ConfigSync when PRs merge to your config repo. Team members auto-pull the updates.
The Use Case: Config as Code
Some teams manage their shared configurations in a git repository. Editor settings, linter rules, git hooks, and shell aliases live in a repo where changes go through code review. This is great for visibility and collaboration, but it creates a distribution problem: after a PR merges, how do team members get the updated configs onto their machines?
The answer is usually "hope they remember to pull." With ConfigSync and GitHub Actions, you can automate the distribution. When a PR merges to your config repo, a GitHub Action pushes the updated configs to ConfigSync. Team members who have auto-pull enabled get the changes automatically.
Setting Up the Config Repo
First, create a repository that contains your team's shared configurations. This repo becomes the source of truth for team-wide settings.
Team members submit PRs to change shared configs. The PR review process provides visibility and prevents unintended changes. Once merged, the GitHub Action handles distribution.
The GitHub Action Workflow
Here is the complete workflow file. It installs ConfigSync, authenticates with a service token, copies the repo configs to the right locations, and pushes a new snapshot.
CONFIGSYNC_TOKEN. Use a dedicated service token with push-only scope so the CI environment cannot pull secrets.Creating the Service Token
Create a dedicated API token for GitHub Actions. This token should have permission to push configs but not to pull secrets.
Team Members Receiving Updates
Once the GitHub Action pushes new configs, team members receive them in one of two ways:
Triggering on Specific File Changes
The workflow uses path filters so it only runs when configuration files change. Changes to the README or other non-config files do not trigger a sync.
The Complete Flow
Putting it all together, the workflow is:
- A team member submits a PR to change
.eslintrc.jsonin the config repo. - The team reviews and approves the change.
- The PR merges to main.
- The GitHub Action triggers, installs ConfigSync, authenticates, and pushes the updated config.
- Team members with watch mode receive the update automatically. Others pull manually.
- Everyone's linter now uses the same rules, without anyone manually copying files.
This pattern treats team configurations as code: version controlled, reviewed, and automatically distributed. It eliminates the gap between "we agreed on new linter rules" and "everyone is actually using the new linter rules." The GitHub Action is the bridge that makes config standardization self-enforcing.
Ready to try ConfigSync?
Sync your entire dev environment across machines in minutes. Free forever for up to 3 devices.