DEV Community

Discussion on: Manage your dev.to blog posts from a GIT repo and use continuous deployment to auto publish/update them

Collapse
 
crisarji profile image
crisarji

Hey sir! awesome post, just started posting on my own and I am following this approach.

Something that happened to me, and I want to share it here(I was looking among comments but did not find the same issue) was that the very first post worked like a charm in TravisCI!, but the second started to complain, I kept receiving this error message in TravisCI job log:

0.92s$ if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then DEV_TO_GIT_TOKEN=$DEV_TO_GIT_TOKEN yarn run dev-to-git; fi
yarn run v1.3.2
(node:6600) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning package.json: No license field
$ dev-to-git
[PUBLISHED] Article "Authentication with Vue(x)+Firebase" is already up to date
[DRAFT] Article "Adding roles to the authentication with Vue(x)+Firebase" encountered an error:
Error name: "HTTPError"
Error message: "Response code 422 (Unprocessable Entity)"
Error stack: "HTTPError: Response code 422 (Unprocessable Entity)
    at EventEmitter.emitter.on (..../blogs-dev.to/node_modules/dev-to-git/bin/dev-to-git.umd.js:7080:23)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)"
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Done. Your build exited with 0.
Enter fullscreen mode Exit fullscreen mode

The PUBLISHED was a success every single time, the DRAFT kept showing that error(odd, with a 0 exited, so it was ok(?), or at least not affecting the status) till I manually set the published: true, then the next build the error was gone.

Just wanted to share in case that this could be relevant for anyone else.