extract_prs_from_branch

extracts a list of open/closed/all PRs from a branch

Intended to help release managers know what’s in an impending release, this generates a list of GitHub Pull Requests that have been merged into the history of the specified branch, are pending merge, or both.

NOTE: because of ruby + shell weirdness it may not see the EXTRACT_PRS_TOKEN even when you have it set in your shell’s environment.

To address this you can invoke it like this:

EXTRACT_PRS_TOKEN=$EXTRACT_PRS_TOKEN extract_prs_from_branch main

Example (from Mastodon’s main repo):

❯ EXTRACT_PRS_TOKEN=$EXTRACT_PRS_TOKEN extract_prs_from_branch main
* Otachon v4.0.2
  by Otakan951
  https://github.com/mastodon/mastodon/pull/20784
* Use 'wasm-unsafe-eval' in CSP
  by prplecake
  https://github.com/mastodon/mastodon/pull/20732
* Fix wrong directive `unsafe-wasm-eval` to `wasm-unsafe-eval`
  by mastodon
  https://github.com/mastodon/mastodon/pull/20729
* Bump version to 4.0.2
  by mastodon
  https://github.com/mastodon/mastodon/pull/20725

(There were, of course, many more entries.)

Prerequisites:

  • octokit gem
  • faraday-retry gem
  • EXTRACT_PRS_TOKEN env var a personal access token created in GitHub for this app. Use a fine-grained token and give it read-only access to Contents, Metadata, Pull Requests.

Your GitHub Personal Access Tokens

Usage

USAGE: extract_prs_from_branch <branch> [<status>]
       status is optional and can be 'all', 'open', or 'closed'

       Defaults to looking for closed PRs.
       This is to help release managers know what's
       in the impending release.

       NOTE: EXTRACT_PRS_TOKEN environment variable
       must be set with a GitHub Personal API token.
       A personal access token created in GitHub for this app.
       Use a fine-grained token and give it read-only access
       to Contents, Metadata, Pull Requests.

       Call with -h to see this message again.

Metadata:

Tags:

  • prs
  • release_management
  • ruby