Patchworks

GitHub Action Setup

Setting up the Patchworks GitHub Action

GitHub Action Setup

Patchworks can automatically check for updates from your template repository using GitHub Actions. When you create a new project with patchworks create, a GitHub Action workflow file is automatically created for you.

Default Workflow

The default workflow file is created at .github/workflows/patchworks.yaml and looks like this:

name: Patchworks
 
on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"
 
jobs:
  patchworks:
    runs-on: ubuntu-latest
    steps:
      - uses: ludicroushq/patchworks@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This workflow:

  • Can be manually triggered with workflow_dispatch
  • Runs automatically at midnight every day (cron: '0 0 * * *')
  • Uses the latest version of the Patchworks GitHub Action

Customizing the Schedule

You can customize the workflow file to change when it runs. For example, to run weekly instead of daily:

name: Patchworks Weekly Check
 
on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * 0" # Run at midnight every Sunday
 
jobs:
  patchworks:
    runs-on: ubuntu-latest
    steps:
      - uses: ludicroushq/patchworks@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Note: The GitHub Action is currently under development. Check back for updates on additional features and options.

Advanced Inputs

The action is a thin wrapper around the patchworks update CLI. The only configurable input is patchworks-package, which tells npx which version of Patchworks to run (e.g. patchworks@latest, patchworks@0.0.3, or a pkg.pr.new tarball).

For local automation you can run the same command directly: npx patchworks update (add --json if you want structured output).

Behind the scenes the composite action commits the prepared diff and opens a pull request with peter-evans/create-pull-request. If the update branch already has an open PR, the action updates that PR instead of creating duplicates.

On this page