admin管理员组

文章数量:1357389

I developed a nice workflow a few years ago to keep an inventory of items on our university's github enterprise instance; unfortunately changes to github Projects (Classic being sunset) and APIs have broken my scripts and I can't seem to find a fix. Here's what I was doing, and hope to return to:

  • Enter an item as Issue, including a photo of the item uploaded on github.
  • In Projects, anise them in a kanban layout to keep track of the location of each item, as we move them around different shelves in physical space.
  • A script (using R, curl, gh, but that's largely irrelevant) to grab the content of each issue and produce an Excel spreadsheet for each shelf (kanban column) listing the item titles, location, persons in charge, details (body of the issue), and the photo that had been uploaded. This is the step that's now broken for me.

When I look at the URL for image attachments on the webpage, it looks like this: https://media.<GHE-instance>/user/122/files/xx68ccf3-5035-4d1a-8f57-074d530e492c?token=XXXX6S6KNSZS6T66BUI57DH5HWOE

but the token is added automagically to the URL that is stored in the issue itself, and I cannot figure out how to produce such a token programmatically.

Is it a one-time token created on the fly? Can I create a longer lasting one that will work for all images while I grab them?

本文标签: Programmatically retrieving images from github issuesaccess tokenStack Overflow