Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/babbel/stale-pr-reporter
Stale PR Reporter is a GitHub Action designed to notify a Slack when pull requests from Dependabot and Renovate have become stale based on a specified timeframe.
https://github.com/babbel/stale-pr-reporter
actions
Last synced: about 2 months ago
JSON representation
Stale PR Reporter is a GitHub Action designed to notify a Slack when pull requests from Dependabot and Renovate have become stale based on a specified timeframe.
- Host: GitHub
- URL: https://github.com/babbel/stale-pr-reporter
- Owner: babbel
- Created: 2024-05-27T14:55:17.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-06T14:07:16.000Z (8 months ago)
- Last Synced: 2024-06-07T12:20:54.838Z (7 months ago)
- Topics: actions
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stale PR Reporter
Github Action to report stale PRs from dependabot/renovate to the slack channel.## Overview
The **Stale PR Reporter** is a GitHub Action designed to report Slack when pull requests from Dependabot and Renovate have become stale based on a specified timeframe. This action is useful for teams that want to keep track of aging PRs to ensure they are reviewed and merged in a timely manner.## Features
- Checks for open pull requests from Dependabot and Renovate.
- Reports to Slack if these PRs have been open longer than a specified number of hours (default: 48 hours).
- Configurable threshold for PR staleness.## Inputs
### `pr_age_in_hours`
- **Description**: Total number of hours since the Pull Request (PR) was opened. If a PR exceeds this age, it will be considered stale.
- **Required**: No
- **Default**: 48 hours### `slack_webhook_url`
- **Description**: The Slack webhook URL where notifications will be sent.
- **Required**: Yes## Usage
### Setup
1. **Create a Slack Webhook**:
- Navigate to your Slack App settings and create a new incoming webhook.
- Copy the webhook URL which will be used to send notifications from this action.
- Add the webhook secret to SecretsManager2. **Add the GitHub Action to Your Repository**:
- Create a directory `.github/workflows` in your repository if it doesn't already exist.
- Add a new YAML file in this directory for the workflow, e.g., `stale-pr-reporter.yml`.### Example Workflow File
Create a file named `.github/workflows/stale-pr-reporter.yml` and add the following content:
yaml name: Stale PR Reporter
```
on:
schedule:
- cron: '0 * * * *' # Runs every hour, adjust as necessaryjobs:
check-open-prs:
runs-on: ubuntu-latest
steps:
- name: Report to Slack
uses: babbel/[email protected]
with:
slack_webhook_url: ${{ secrets.slack_webhook_url }}
pr_age_in_hours: 24
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```