DEV Community

Cover image for Publish DEV articles from a Git repo, with Github + Pipedream

Publish DEV articles from a Git repo, with Github + Pipedream

Dylan J. Sather on June 10, 2020

I wrote this article with VS Code, on my Mac, and published it by running git push. All my DEV posts are tracked by Git, and I can manage them from...
Collapse
 
mikeyglitz profile image
mikeyGlitz • Edited

I'm seeing the errors in my trigger code, but I see getFileContents() in my code and default_branch is in the response I get back from GitHub. What's wrong with the pipeline configuration?

Errors From Event

Collapse
 
dylburger profile image
Dylan J. Sather • Edited

I apologize, for some reason the trigger step was using old code. If you don't mind, try clicking on the Configuration tab on that screen to view the source's code, then paste in the code for the newest version. Then you'll see an option to Update Code to the right. Try pushing a new commit after that.

I updated the workflow to use the newest version, too, so you can also copy it anew and that should work.

Appreciate you letting me know! Please tell me if this doesn't fix it or if you have any other issues.

Collapse
 
mikeyglitz profile image
mikeyGlitz

github.com/dylburger/dev-to-posts/...
getContents() is not a valid function. Checking the Octokit API, getContent() is the method you're looking for.

Thread Thread
 
dylburger profile image
Dylan J. Sather

Nice catch. It's funny because the plural method still worked for me - did it fail for you?

At any rate, newest version of the code should reference getContent.

Thread Thread
 
mikeyglitz profile image
mikeyGlitz

Yeah it failed for me, I got a null error when it ran.

Thread Thread
 
dylburger profile image
Dylan J. Sather

Does the code with getContent work for you now?

Thread Thread
 
mikeyglitz profile image
mikeyGlitz

Yup. Thanks!

Thread Thread
 
dylburger profile image
Dylan J. Sather

Great thanks for the back and forth and for reporting these errors.

Collapse
 
saschadev profile image
Der Sascha

Nice this sounds like ittt but for pros πŸ‘

Collapse
 
yusufcodes profile image
yusufcodes

This is awesome. Want to get back into posting on here so will look to set this up soon🀩

Collapse
 
sm0ke profile image
Sm0ke

Niceeeee. Thanks for writing!

Collapse
 
muhimen123 profile image
Muhimen

I write my dev posts in the terminal using vim and then publish it using an API wrapper I made, with python.

Collapse
 
dylburger profile image
Dylan J. Sather

That’s awesome. Do you run a Python script after editing or did you set it up as a Vim plugin to run commands to publish?

Collapse
 
muhimen123 profile image
Muhimen

I just edit it with vim(actually neovim) and then run the script. I just need to mention the name of the file.

Collapse
 
ugglr profile image
Carl-W

This is awesome! Thanks for sharing!

Collapse
 
dylburger profile image
Dylan J. Sather

Thank you Carl!

Collapse
 
farhanaxmustafa profile image
Farhana

Thank you for sharing! I've been writing my drafts in google docs and manually copying, pasting and editing in the markdown. Def trying this out

Collapse
 
isabelxklee profile image
isabel k. lee

This is so helpful, thanks for sharing Dylan!!!

Collapse
 
dylburger profile image
Dylan J. Sather

Thank you for the kind note, Isabel!