Automatically sync your repository with updates from its template source.
When you clone a template repository, you lose the connection to the original template. If the template author fixes a bug or makes an improvement, there's no easy way to pull those changes into your repository.
Patchworks creates an automated system that tracks which template repository your project was based on and helps you stay updated with changes.
- Fetches the template repository nightly and advances one commit past the tracked hash when updates exist.
- Applies a whitespace-tolerant diff, leaving
.rejfiles alongside files that need manual attention. - Updates
.patchworks.json, commits onpatchworks/update, and force-pushes the branch. - Skips runs when a Patchworks update PR already exists and opens a fresh PR with a summary and reject list otherwise.
- Lists any
.rejfiles in the PR body so you can review conflicts directly from the diff.
The action now wraps a composite workflow around the CLI and the peter-evans/create-pull-request action:
jobs:
patchworks:
runs-on: ubuntu-latest
steps:
- uses: ludicroushq/patchworks@v0
with:
patchworks-package: patchworks@latest # or https://pkg.pr.new/org/patchworks@commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Inputs let you override the Node version, branch name, base branch, git identity, or even point to a canary tarball published by pkg.pr.new. Any values passed through with: are forwarded to the underlying patchworks update CLI, which prepares the diff; the composite then commits and opens the PR via create-pull-request.
patchworks updateruns the same sync logic against the current repository and leaves the changes in your working tree so you can review them before committing. Add--jsonwhen you want structured metadata for scripts.GITHUB_TOKEN(or--token) must have permission to push branches and create pull requests.
The generated workflow grants contents: write and pull-requests: write, checks out the repository with fetch-depth: 0, and exposes GITHUB_TOKEN to the action. Advanced users can override behaviour with environment variables such as PATCHWORKS_BASE_BRANCH, PATCHWORKS_BRANCH_NAME, PATCHWORKS_GIT_NAME, and PATCHWORKS_GIT_EMAIL.
For installation instructions, usage guides, and more detailed information, visit our documentation at patchworks.dev.
MIT