Skip to content

oppia/stale-review-request-notifier

Repository files navigation

stale-review-request-notifier GitHub Action

Action to send notifications to reviewers on github-discussion when they miss reviewing PRs within expected time.

Table of Contents

Usage

  1. Generate a github-personal-access-token with rights to create discussion and read issues & pull request. image image

  2. Create a new repository secret (assuming DISCUSSION_NOTIFICATION_TOKEN) with value as the newly generated personal access token.

  3. Create a GitHub discussion and then a workflow file in the .github/workflows/ dir.

    Example:

    name: Send pending review notifications to reviewer on github-discussion
    on:
      schedule:
        - cron: '0 0 * * 2,4'
    
    jobs:
      send_notifications:
        name: Send pending review notifications
        runs-on:  ${{ matrix.os }}
        strategy:
          matrix:
            os: [ubuntu-22.04]
        steps:
          - uses: actions/checkout@v3
          - uses: actions/setup-python@v4
            with:
              python-version: '3.8.15'
              architecture: 'x64'
          - uses: oppia/stale-review-request-notifier
            with:
              category-name: << category_name >>
              discussion-title: << discussion_title >>
              repo-token: ${{ secrets.DISCUSSION_NOTIFICATION_TOKEN }}
              review-turnaround-hours: << TURNAROUND_HOURS >>

    Important notes:

    • Replace << category_name >> and << discussion_title >> with the respective category name and discussion title.
    • Replace << TURNAROUND_HOURS >> with the expected PR review time.
    • Don't use space in category_name or discussion_title; otherwise, they will be considered different arguments.
    • The POSIX cron syntax needs to be quoted as * is a special character in YAML.

Inputs

Name Requirement Default Description
category-name required The category name the discussion belongs to.
discussion-title required The title of the discussion in which comments will be posted.
repo-token required The github-personal-token which at least have rights to create a discussion in the given team.
review-turnaround-hours required The maximum review turnaround hours. Notifications will be sent only for PRs waiting for more than review-turnaround-hours.

Known issue

The secret.GITHUB_TOKEN available in build container doesn't have permission to create discussion in team.

License

See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages