GitHub Action

Automated dependency override management for CI/CD

Quick Start

Basic PR Check

name: Override Check
on: [pull_request]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: yowainwright/pastoralist@v1
        with:
          mode: check
          check-security: false

The action enables OSV security scanning by default. Set check-security: false when you only want to validate override tracking.

Scheduled Maintenance with PR Creation

name: Override Maintenance
on:
  schedule:
    - cron: "0 0 * * 1" # Weekly on Monday

permissions:
  contents: write
  pull-requests: write

jobs:
  maintain:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: yowainwright/pastoralist@v1
        with:
          mode: pr
          pr-title: "chore(deps): update dependency overrides"
          pr-labels: "dependencies automated"

Modes

ModeDescription
checkValidate only - reports issues without modifying files
updateModify package.json (default) - you handle commits
prCreate pull request with changes automatically

Check Mode

Runs pastoralist in dry-run mode. Reports issues without modifying files.

- uses: yowainwright/pastoralist@v1
  with:
    mode: check

Update Mode (Default)

Runs pastoralist and modifies package.json. Use when you want to handle commits yourself.

- uses: actions/checkout@v7

- uses: yowainwright/pastoralist@v1
  with:
    mode: update

- name: Commit changes
  run: |
    git config user.name github-actions[bot]
    git config user.email github-actions[bot]@users.noreply.github.com
    git add package.json
    git diff --staged --quiet || git commit -m "chore: update overrides"
    git push

PR Mode

Runs pastoralist and creates a PR if changes are needed. Ideal for scheduled workflows. Use this mode with contents: write and pull-requests: write workflow permissions.

- uses: yowainwright/pastoralist@v1
  with:
    mode: pr
    pr-title: "fix(security): update vulnerable overrides"

Inputs

InputDescriptionDefault
modeOperation mode: check, update, or prupdate
check-securityEnable security scanningtrue
security-providerProvider: osv, github, npm, snyk, socket, spektionosv
security-tokenToken for security provider-
auto-fixApply security fixes automatically when the action can writetrue
dry-runPreview changes onlyfalse
root-dirProject root directory-
dep-pathsWorkspace patterns (space-separated)-
configDeprecated; config files are auto-detected from root-dir-
fail-on-securityFail if vulnerabilities foundtrue
fail-on-unusedFail if unused overrides foundfalse
silentDeprecated compatibility input; ignored with a warningfalse
debugEnable debug loggingfalse
pr-titlePR title (mode: pr)chore(deps): update dependency overrides
pr-bodyPR body (mode: pr)Auto-generated
pr-branchPR branch name (mode: pr)pastoralist/updates
pr-labelsPR labels (space-separated)dependencies
github-tokenGitHub token for PR creationGITHUB_TOKEN

Outputs

OutputDescription
has-security-issuestrue if vulnerabilities were found
has-unused-overridestrue if unused overrides detected
updatedtrue if package.json was modified
security-countNumber of security vulnerabilities found
unused-countNumber of unused overrides detected
override-countNumber of tracked overrides
pr-urlURL of created PR (mode: pr only)

Examples

PR Check with Security Gate

name: Override Security
on: [pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - uses: yowainwright/pastoralist@v1
        with:
          mode: check
          fail-on-security: true
          security-provider: osv

Monorepo Support

- uses: yowainwright/pastoralist@v1
  with:
    dep-paths: "packages/*/package.json apps/*/package.json"

Using GitHub Security Provider

- uses: yowainwright/pastoralist@v1
  with:
    security-provider: github
    security-token: ${{ secrets.GITHUB_TOKEN }}

Conditional PR on Vulnerabilities

- uses: yowainwright/pastoralist@v1
  id: pastoralist
  with:
    mode: check

- name: Create security PR
  if: steps.pastoralist.outputs.has-security-issues == 'true'
  run: |
    # Custom PR logic here

Weekly Maintenance with Slack Notification

name: Weekly Override Maintenance
on:
  schedule:
    - cron: "0 9 * * 1"

permissions:
  contents: write
  pull-requests: write

jobs:
  maintain:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - uses: yowainwright/pastoralist@v1
        id: pastoralist
        with:
          mode: pr

      - name: Notify Slack
        if: steps.pastoralist.outputs.pr-url != ''
        uses: slackapi/[email protected]
        with:
          payload: |
            {
              "text": "Pastoralist created a PR: ${{ steps.pastoralist.outputs.pr-url }}"
            }

Permissions

For mode: pr, the action needs write permissions:

permissions:
  contents: write
  pull-requests: write

Security Providers

ProviderAuthNotes
osvNoneOpen Source Vulnerabilities database (default)
npmNoneUses the detected package manager's audit command
githubRequiredReads Dependabot alerts; pass GITHUB_TOKEN or rely on an authenticated gh CLI session
snykRequiredRequires SNYK_TOKEN [EXPERIMENTAL]
socketRequiredRequires SOCKET_SECURITY_API_KEY [EXPERIMENTAL]
spektionRequiredRequires SPEKTION_API_KEY [EXPERIMENTAL]

Copyright © 2026 - All rights reserved

Pastoralist Logo