Skip to content

About

CI tool to automate WordPress asset updates for Git controlled websites

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Repository files navigation

WP Git Updater

GitHub Workflow Status GitHub Release (latest by date) GitHub go.mod Go version GitHub Issues GitHub Stars GitHub License

Automated source-controlled WordPress plugin and theme updates. WP Git Updater checks WordPress.org for new versions, commits each update on its own branch, and opens a GitHub pull request.

No WP Git Updater account, service token, license check, or usage quota is required. The tool does not send usage statistics. It contacts WordPress.org for update information and downloads, and your Git host and GitHub API for branches and pull requests.

Installation

curl https://install.wpgitupdater.dev/install.sh | bash -s -- -b $HOME/bin

Install a release from GitHub into $HOME/bin:

curl https://install.wpgitupdater.dev/install.sh | bash -s -- -b $HOME/bin

Ensure $HOME/bin is on your PATH. You can also download a binary from GitHub Releases, or build from a checkout with Go:

go build -o wpgitupdater .

Usage

Run commands from the root of your site's Git repository. Generate the configuration file and adjust the plugin and theme paths to match your repository:

wpgitupdater init

Set WP_GIT_UPDATER_GIT_TOKEN to a GitHub token for your repository before running list or update. Updating requires permission to push branches and create pull requests. This is your GitHub credential; there is no separate updater service credential.

export WP_GIT_UPDATER_GIT_TOKEN="YOUR_GITHUB_TOKEN"

# List plugin and theme update statuses
wpgitupdater list

# List only plugin update statuses
wpgitupdater list -themes=false

# Check updates without creating update branches
wpgitupdater update -dry-run

# Download updates, commit and push branches, and create pull requests
wpgitupdater update

The list command supports -plugins=false and -themes=false. The update command respects the enabled settings in the configuration and skips updates whose remote branches already exist. The old update -stats flag is accepted for compatibility and has no effect.

Configuration

The .wpgitupdater.yml file generated by init contains:

version: "1.0"
plugins:
  enabled: true
  path: plugins
themes:
  enabled: true
  path: themes

Paths are relative to the repository root. For a standard WordPress checkout, use wp-content/plugins and wp-content/themes.

Both plugins and themes support include and exclude lists of directory names. A nonempty include list takes precedence over exclude. The optional commit and title settings customize commit messages and pull request titles using :plugin or :theme, :oldversion, and :newversion placeholders. A top-level branch setting selects the pull request base branch; by default, the current branch is used. See the annotated example configuration.

GitHub Actions

Generate a scheduled workflow with:

wpgitupdater init -ci -actions

This writes .github/workflows/wpgitupdater.yml and uses the workflow's GITHUB_TOKEN as WP_GIT_UPDATER_GIT_TOKEN. Review its branch checkout and ensure the token can push branches and create pull requests for your repository. Existing workflows can remove WP_GIT_UPDATER_TOKEN.

About

CI tool to automate WordPress asset updates for Git controlled websites

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages