Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.52 KB

README.md

File metadata and controls

42 lines (32 loc) · 1.52 KB

dismiss-stale-approvals

A GitHub action to automatically dismiss stale approvals on pull requests. Unlike the built in GitHub protection, this action will compare the git range-diff of the new version against the previous version, and only dismiss approvals if the diff has changed.

Usage

  1. Add the below worklow to your repository's .github/workflows directory.
  2. Ensure that the "Dismiss stale pull request approvals" check is required for pull requests, which will ensure that PRs cannot be merged until the action has run successfully.

You can make the check required with either:

See the example repository for a complete example.

name: Dismiss stale pull request approvals

on:
  pull_request:
    types: [
        opened,
        synchronize,
        reopened,
      ]


permissions:
  actions: read
  contents: read
  pull-requests: write

jobs:
  dismiss_stale_approvals:
    runs-on: ubuntu-latest
    steps:
      - name: Dismiss stale pull request approvals
        uses: withgraphite/dismiss-stale-approvals@main
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}