I have a family plan that I’ve built a few sites around, each with their own custom themes in separate GitHub repos. I’d like to automate deploying changes to my micro.blog sites. When I want to deploy, I have to go to Design → Edit Theme → My Theme → Sync with Github, then to feel safe I often go to Accounts → Logs → Rebuild. I find I’m doing this over and over, so it would be better if I could automate this with a Github Action. Do you guys have a supported way of doing this?
No, there’s no official public API to accomplish this, but since it’s all just the web, you could theoretically figure out the necessary HTTP requests and call them in order from your GitHub Action.
This was my thought too, seems like some well crafted curl calls or a playwright script would do the trick. Is that something you guys would be OK if I build?
I suppose the big question is, if I tried to do the curl approach is there anything where I can use the app tokens to authenticate?
I’m a nerd for this kind of thing so would be happy to publish whatever comes of it so other can use!
I’m just guessing here, but I can’t imagine @manton caring what web browser or agent (like curl) you’re using, as long as you follow the terms of service and stay within the rate limit, etc. But that’s just my guess. ![]()
I don’t know of any documentation on how the web app works, so you’ll probably have to reverse-engineer which requests to make. The authentication cookie is called rack.session.
Thinking out loud, I see we can create multiple passkeys per user so seems like we could use that for the initial authentication and to fetch this session cookie, then I imagine we could hit specific endpoints as needed. I’ll play with this a bit! Thanks for the help!
This took a bit of playing around to get it to work, but I think I worked it out. For anyone curious, take a look at this: adobe-digest/.github/deploy at main · doughatcher/adobe-digest · GitHub
This Github Action will POST an email address to the signin page, and use an IMAP library to poll my email for the magic link, and follow it to fetch this session id and then it performs the sequence to trigger the key steps. Works well so far!