GitHub Gist Action

I’m looking for an action to do something I’d love, but it seems there’s none.
I’m not a coder, so I don’t have the required skills to pull this one off, if indeed this is possible to do. This post is, truth be told, a feature request, or an action request.

I sometimes create and post notes to GitHub Gist, private ones mostly, to share with friends. I do this for travel tips, sharing tips about places I’ve been with friends who are visiting the same places, or small tutorials for other ones. You get the idea…

Usually I do this on desktop, with Sublime Text, which lets me create Gists from the app, or using some other app on the iPhone (Working Copy is amazing).

Most are Markdown notes, I take great care in formatting and adding photos of the places they’ll see, or screenshots for the tutorials.

I could obviously edit the whole thing with Drafts, and copy and paste the text on a browser window, but it would be amazing to be able to do this with an action.

It would have, in my dreams, the same workflow used on Sublime. Edit text, create gist (picking secret or public), name it, add optional description, done.
If you’re editing an existing gist, it would update that one.

Would it be possible to do this with Drafts ?

Here’s an old Post Gist example action.

It used to work, but no longer does because it posts anonymously, and GitHub stopped allowing that a while back.

I haven’t had time to look at updating it, but in theory it could be updated to pass auth information.

1 Like

Thanks.

I’ll try to figure it out, mixing it with another action I found here that supposedly updates a GitHub repo, but I’m might be way over my head with this one.

The other user managed to get logged in to update his chosen repo, I’ll try to use his credential code on your action. Thanks again.

I updated my Post Gist to GitHub example action to support authentication. Read the notes about generating a personal token for use with the action.

3 Likes

You, sir, are the best! I had the token all ready to go! Thank you!!

Thanks for this script, I’m trying to create then update gists, but I’m lost looking through the scripting and api docs, any pointers as to how the action could be made to add (and then if existing) update a gist?

Many thanks, Terry

It would be similar, but you need to know the gist_id of the item you plan to update and incorporate it into the parameters and URL. The API docs are here.

Do you have an existing Gist you just want a static action to update?

1 Like