Skip to content

Instantly share code, notes, and snippets.

@lgfa29
Last active December 4, 2019 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgfa29/69f8b9f4e18a39696883c6596bb34427 to your computer and use it in GitHub Desktop.
Save lgfa29/69f8b9f4e18a39696883c6596bb34427 to your computer and use it in GitHub Desktop.

How to use it

  1. Create a GitHub Personal Access Token with the read:org permission.
  2. Copy the contents of bookmarklet.js and replace the placeholders with your specific values.
  3. Add a new bookmark to your browser using that as the URL.
javascript:user="YOUR USERNAME",token="YOUR TOKEN",org="TEAM ORG",team="TEAM NAME",repos=["OWNER/REPO","OWNER/REPO2"],openOnly=true,internalOnly=false,query=[],opts={headers:{Authorization:"Basic "+btoa(user+":"+token)}},fetch("https://api.github.com/orgs/"+org+"/teams/"+team,opts).then(r=>{r.json().then(t=>{fetch("https://api.github.com/teams/"+t.id+"/members",opts).then(r=>{r.json().then(d=>{openOnly&&query.push(encodeURIComponent("is:open")),repos.map(repo=>query.push(encodeURIComponent("repo:"+repo))),d.map(m=>query.push((internalOnly?"":"-")+encodeURIComponent("author:"+m.login))),window.location="https://github.com/search?type=Issues&q="+query.join("+")})})})});
user='YOUR USERNAME';
token='YOUR TOKEN';
org='TEAM ORG';
team='TEAM NAME';
repos=['OWNER/REPO','OWNER/REPO2'];
openOnly=true;
internalOnly=false;
query = [];
opts = { headers: { 'Authorization': 'Basic ' + btoa(user+':'+token) } };
fetch('https://api.github.com/orgs/'+org+'/teams/'+team, opts).then(r => {
r.json().then(t => {
fetch('https://api.github.com/teams/'+t.id+'/members', opts).then(r => {
r.json().then(d => {
if (openOnly) { query.push(encodeURIComponent('is:open')); }
repos.map(repo => query.push(encodeURIComponent('repo:'+repo)));
d.map(m => query.push((internalOnly ? '': '-')+encodeURIComponent('author:'+m.login)))
window.location='https://github.com/search?type=Issues&q='+query.join('+');
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment