medicode/Dismiss reviews if stale
An action which will dismiss reviews if they are stale. Notably, this action behaves correctly even if the branch was rebased or force pushed (versus GitHub's built-in dismiss if stale functionality).
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
- Runtime
- Deprecated runtime
Inputs
| name | description | required | default |
|---|---|---|---|
| mode | Specify either "check-for-approvals" or "dismiss-stale-reviews" | yes | — |
| path_to_cached_diff | Path to the cached diff file. Only required for dismiss-stale-reviews mode. | — | — |
| path_to_cached_metadata | Path to the cached approval metadata JSON file. Used for range-diff comparison which is more accurate for rebased branches. If not provided or file doesn't exist, falls back to diff comparison. Only relevant in dismiss-stale-reviews mode. | — | — |
| token | GitHub token - at a minimum, this must have 'contents: read' and 'pull-requests: write' permissions. | — | ${{ github.token }} |
| diffs_directory | Optional directory to store diffs - useful for debugging what changes led to approval dismissals. Only relevant in dismiss-stale-reviews mode. | — | — |
| range_diff_fetch_depth | Maximum number of commits to fetch when setting up the repo for git range-diff. Lower values speed up the fetch but may cause range-diff to fail if the commit ranges are deeper than this limit. Set to 0 for unlimited depth. Only relevant in dismiss-stale-reviews mode. | — | 250 |
| repo_path | Path to the repo for the pull request - if the repo is not already checked out to this path, then it will be. There are some cases where we need to compute the diff using git and the repo directly. Only relevant in dismiss-stale-reviews mode. | — | ${{ github.workspace }} |
Outputs
| name | description |
|---|---|
| approved_sha | The SHA of the commit that was approved. Only set in check-for-approvals mode, and if there is an approval on the PR. Otherwise, this will be an empty string. |
| review_id | The ID of the approval review. Used for cache key lookup. Only set (non-empty) in check-for-approvals mode when there is an approval on the PR. Empty string if there are no approvals or in dismiss-stale-reviews mode. |