Skip to content

Instantly share code, notes, and snippets.

@devnoname120
Created January 16, 2025 14:27
Show Gist options
  • Save devnoname120/b22b54cbead0ad5d53009ef4daabb0c1 to your computer and use it in GitHub Desktop.
Save devnoname120/b22b54cbead0ad5d53009ef4daabb0c1 to your computer and use it in GitHub Desktop.
Approve all pull requests where someone requested a review from me
  1. Go to https://github.com/issues?q=review-requested%3A%40me
  2. Open the dev console, run this, and copy the output:
const pulls = Array.from(document.querySelectorAll('a[id^=issue_]'))
const links = pulls.map(i => i.href.replace('//github.com/', '//api.github.com/repos/').replace('/pull/', '/pulls/') + '/reviews')
const curls = links.map(l => `curl -H "Authorization: Bearer $GITHUB_TOKEN" --data '{"event": "APPROVE"}' ${l}`)
console.log(curls.join("\n"))
  1. Run this in the terminal:
export GITHUB_TOKEN=ghp_xxxxxxxxxxx
  1. Paste the output of step 2. in the terminal and press Return.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment