DEV Community

Cover image for My setup for publishing to Dev.to using github

My setup for publishing to Dev.to using github

Jack Lewis on February 11, 2023

This article is mainly around so that I can remember my current setup, and maybe it'll help you be more productive, but it's essentially a GUID on ...
Collapse
 
k1lgor profile image
k1lgor

using ur workflow and the template and every time gives me the same error:

Error: end of the stream or a document separator is expected at line 9, column 1:
    One of the most basic uses of th ... 
    ^
Push failed

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Error: Error: Table must define at least one row.
Enter fullscreen mode Exit fullscreen mode

Any idea how to fix it ?

Collapse
 
jlewis92 profile image
Jack Lewis • Edited

Hope you don't mind, but I grabbed a copy of the article from your repo to try testing for myself and I got it to fail with a different error from what you got. However, what's interesting is I tried again by removing backticks from the headers and I got it to post. Even more interesting, I then added the backticks back in and got it to post with them.

I thin k what's happening is that on first push of a new article, the build will fail. However, once you update something (the removal of backticks didn't really matter) it seems to pick everything up correctly

Collapse
 
k1lgor profile image
k1lgor

not working for me somehow, just forked ur repo and change only the title, it throws the same error

Thread Thread
 
jlewis92 profile image
Jack Lewis

I think you've got the repo set to private so I can't see what's happening but it should be slightly different at least? I don't think I have One of the most basic uses of th... within my repository? Are you running this locally, or via GitHub? The line endings stuff sort of makes me suspect it's some sort of mismatch between Windows and Linux - I did try changing everything to use LF rather than CRLF, but that seems to have worked

Thread Thread
 
k1lgor profile image
k1lgor

I also don't have this One of the most... in the markdown or any other file. This is the strangest thing. I figured it out that this one is a sentence from my first article but how is related I dunno... Tried to changed it but the same result.

Thread Thread
 
jlewis92 profile image
Jack Lewis

The first step of the runner is retrieving articles from dev.to, for some reason it's complaining about an article you've already written, as it seems to think one of you posts is malformed - why it's saying that I'm not sure as I can't see your markdown

You could try pulling down your posts via the API and seeing if it has any issues, or maybe try recreating the post (after backing up of course)? I did try just creating a post on the website so I had a mix, and that did seem to work

Thread Thread
 
k1lgor profile image
k1lgor

thanks, i will give it a try

Collapse
 
k1lgor profile image
k1lgor

hmmm, very interesting case.. i will give another try. thanks tho

Collapse
 
caijin5 profile image
Sino wheelabrator
Collapse
 
baddate profile image
SMJ

a little curious, won't there be a problem of posting an article multiple times if adding posts one by one?

Collapse
 
jlewis92 profile image
Jack Lewis

Hi, so this is why the Action needs write access to your repository, what happens when you post is that a bot then commits to your repository with an ID on the new markdown which tracks the articles in DEV.to for updating. If you remove the id, it will just post again though

Collapse
 
k1lgor profile image
k1lgor

hmm, very nice, i gonna try this !