3

I'm developing a probot application to prevent disclosure of sensitive information on github issues.

When I edit out the sensitive information from the github-issue, the information can still be viewed on the post's edit history (revision history) where you can then manually delete them from the UI, as shown: Github-issues-revision-history and deletion

I've been using https://octokit.github.io/rest.js/v18 but there doesn't seem to be a clear endpoint to access said revisions.

Tried various approaches such as

var promise=context.github.issues.listEvents({owner:"james", repo:"test-repo", issue_number:56})
   promise.then((value) => {
  console.log(value);
})

but I can't seem to be able to find where those revisions are saved. Where exactly are those post revisions saved so I can delete them using my probot application?

Zaiton
  • 31
  • 6
  • octokit API scrapes Github API Documentation so, as far as there is an API for it and it's published in Github API Documentation, it should be available. In a quick search I found the regular UI option as you mentioned but I did not find the REST API option on docs.github.com. If there's one, could you share it with us please? This way we can check if it's being scraped correctly. Thanks – OscarDOM Jul 17 '20 at 14:00
  • 2
    @OscarDOM I opened a git-issue with the creator of Probot and apparently there's no REST option to do what I want ( https://github.com/probot/probot/issues/1264 ). I've opened a ticket with github as well to see if this can get implemented in the future or if they have a way around it. For now, it looks like I'll have to go with GraphQL in addition to Probot. – Zaiton Jul 17 '20 at 14:42
  • 1
    The Rest API doesn't expose any endpoint for issue deletion. However, the GraphQL API does provide https://developer.github.com/v4/mutation/deleteissue/ for deleting the issue. No endpoints to delete a specific revision though. – Asif Kamran Malick Jul 23 '20 at 19:43
  • https://octokit.github.io/rest.js/v18#pagination helped me. – Ryan Oct 31 '21 at 20:24

0 Answers0