Automation tools and scripts for GitHub workflow management, including automatic repository configuration and settings management.
Automatically enables the "Always suggest updating pull request branches" setting (allow_update_branch) for:
- New repositories created via GitHub web interface
- New repositories created via CLI
- Existing repositories (one-time batch update)
# Clone the repository
git clone https://github.com/jleechanorg/github_workflow.git
cd github_workflow
# Run the install script
./install.shUse the dedicated replication script when you need a fresh workstation that matches the Codex Web container toolchain (Ubuntu 24.04 base image, language runtimes, and CLI helpers).
# Run as root or with sudo
sudo TARGET_USER="$(whoami)" ./bin/setup-codex-web.shWhat the script configures:
- System dependencies (build-essential, git, ripgrep, jq, etc.) via
apt pyenvwith CPython 3.10.17, 3.11.12, 3.12.10, and 3.13.3 (global default3.12.10)pipxpackages:clang-format,clang-tidy,cmakelang,cpplint,poetry, anduvnvmwith Node.js 20.19.4 plus Corepack-managedpnpm 10.5.2andyarn 4.9.4rustuppinned to Rust 1.89.0misewith Bun 1.2.14, Erlang 27.1.2, Elixir 1.18.3-otp-27, Go 1.24.3, golangci-lint 2.1.6, Gradle 8.14.3, Java 21.0.2, Maven 3.9.10, PHP 8.4.12, Ruby 3.4.4, and Swift 6.1- Shell exports mirroring the Codex Web container (
CODEX_ENV_*variables, PATH hooks for pyenv/nvm/rust/mise)
Set the optional TARGET_USER environment variable when invoking the script to install everything for a specific non-root account.
The environment manifest that drives the installer lives in bin/codex-web-manifest.sh. After running the installer, execute the verification helper (inside a Codex Web shell or a fresh login after installation) to compare your machine against the reference Codex Web container:
bin/verify-codex-web.shThe script checks the OS fingerprint, apt packages, pyenv runtimes, pipx utilities, Node/Corepack, rustup, mise-managed toolchains, and the Codex-specific shell exports. A passing run confirms you are matching the Codex Web environment byte-for-byte.
-
Copy scripts to your bin directory:
cp bin/gh-create-repo-auto ~/bin/ cp bin/github-repo-auto-config.sh ~/bin/ chmod +x ~/bin/gh-create-repo-auto chmod +x ~/bin/github-repo-auto-config.sh
-
Install LaunchAgent for automatic monitoring:
cp launchd/com.github.repo-auto-config.plist ~/Library/LaunchAgents/ # Update the path in the plist if your username differs launchctl load ~/Library/LaunchAgents/com.github.repo-auto-config.plist
-
Add alias to your shell config:
echo 'alias gh-create="gh create-repo-auto"' >> ~/.zshrc source ~/.zshrc
Option 1: Using the wrapper script directly
gh-create-repo-auto jleechanorg/my-new-repo --public --description "My awesome project"Option 2: Using the alias (after installation)
gh-create my-new-repo --public --description "My awesome project"This automatically:
- β Creates the repository
- β
Enables
allow_update_branchsetting - β Shows confirmation
Just create repositories normally on GitHub.com! The background monitoring service will automatically:
- π€ Detect new repos within 30 minutes
- βοΈ Enable the
allow_update_branchsetting - π Log all actions to
~/.github-repo-auto-config.log
To enable the setting for all existing repositories:
~/bin/github-repo-auto-config.shgithub_workflow/
βββ bin/
β βββ gh-create-repo-auto # CLI wrapper for repo creation
β βββ github-repo-auto-config.sh # Background monitoring script
β βββ codex-web-manifest.sh # Shared Codex Web toolchain manifest
β βββ setup-codex-web.sh # Rebuild the Codex Web container toolchain
β βββ verify-codex-web.sh # Validate a machine against Codex Web
βββ launchd/
β βββ com.github.repo-auto-config.plist # macOS LaunchAgent config
βββ install.sh # Quick installation script
βββ README.md # This file
launchctl list | grep githubcat ~/.github-repo-auto-config.log~/bin/github-repo-auto-config.shThe LaunchAgent runs every 30 minutes by default. To change this:
- Edit
~/Library/LaunchAgents/com.github.repo-auto-config.plist - Modify the
StartIntervalvalue (in seconds):- 900 = 15 minutes
- 1800 = 30 minutes (default)
- 3600 = 1 hour
- Reload the LaunchAgent:
launchctl unload ~/Library/LaunchAgents/com.github.repo-auto-config.plist launchctl load ~/Library/LaunchAgents/com.github.repo-auto-config.plist
The script checks repositories created in the last 48 hours. To change this, edit the cutoff_date line in github-repo-auto-config.sh.
By default, scripts are configured for the jleechanorg organization. To use with a different organization:
- Edit
bin/github-repo-auto-config.sh - Change the
ORG="jleechanorg"line to your organization name
- Wrapper around
gh repo create - Accepts all standard
gh repo createarguments - Automatically enables
allow_update_branchafter creation - Provides color-coded success/failure feedback
- Queries GitHub API for recently created repositories
- Checks current
allow_update_branchstatus - Updates setting only if needed
- Logs all actions with timestamps
- Safe to run multiple times (idempotent)
- Runs scripts automatically in the background
- Starts on user login
- Configurable run interval
- Logs stdout/stderr to separate files
- macOS (for LaunchAgent functionality)
- GitHub CLI (
gh) installed and authenticated - Bash shell
- GitHub account with repository creation permissions
Feel free to open issues or submit pull requests for improvements!
MIT License - feel free to use and modify as needed.