Skip to content

Tampermonkey script to add a "copy" button next to commit SHAs on GitHub PR pages

Notifications You must be signed in to change notification settings

nv-gha-runners/add-copy-button-to-commits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

add-copy-button-to-commits

This repository contains the source code for a Tampermonkey script that adds a "copy" button next to commit SHAs on GitHub pull request pages. The screenshot below shows an example of this functionality:

Motivation

The motivation for this script is to make it easier for developers to copy commit SHAs from pull request pages on GitHub.

Without this script, copying SHAs from GitHub's pull request web pages can be a bit tricky. It requires clicking in the exact right location to highlight text. It also requires pasting the SHA as plain-text with CTRL+SHIFT+V vs. CTRL+V (otherwise it pastes the contents as a commit URL, which generally isn't the intended behavior). This script fixes both of those quirks and can be easily used in Chrome, Firefox, Safari, Edge, and Opera as described in the Usage section below.

Usage

Follow the steps below to use the script:

  • Install Tampermonkey in your browser using one of the browser store links below:
  • Perform any necessary browser-specific post-installation steps:
  • Open up the raw file content of add-button.user.js in your browser (using these instructions from GitHub)
  • Tampermonkey will automatically recognize that you've opened up a *.user.js script and prompt you to install it
  • Done! Navigate to a pull request page on GitHub now and you should see the "copy" button next to commit SHAs
    • If you don't see it right away, try closing and reopening your browser

Managing Updates

Since this repository is public, Tampermonkey will periodically check it for updates automatically.

About

Tampermonkey script to add a "copy" button next to commit SHAs on GitHub PR pages

Resources

Stars

Watchers

Forks