sinedied / publish-devto

:postbox: GitHub Action to publish markdown files on dev.to platform, with assets hosted on GitHub.
MIT License
38 stars 8 forks source link

adds dry-run support and outputs #21

Closed pabloromeo closed 2 years ago

pabloromeo commented 2 years ago

Adds support for the dry-run CLI option, as well as output parameters to the github action. The new outputs are 2:

  1. The stringified JSON of the CLI output
  2. A table-like structured output of the CLI results

One comment: When doing a dry-run, if you run it on a PR branch, articles which have no actual changes will still show up as changed, given that the source of the image URLs include the branch name and it will be different between a branch and main.

Given that I've manually moved the changes from another fork you might want to give it a try before merging, to make sure nothing breaks.

sinedied commented 2 years ago

Thanks, looks good to me! I'll probably move the table formatting into the devto CLI at some point as it already have related features, to factorize things a bit.

Now I just need to do some testing and I'll publish the updated action 🎉

sinedied commented 2 years ago

Regarding the changes in the PR branch, this is something that could probably be fixed in the CLI, ie ignoring branch changes when doing the comparison using a flag.

pabloromeo commented 2 years ago

Thanks, looks good to me! I'll probably move the table formatting into the devto CLI at some point as it already have related features, to factorize things a bit.

Now I just need to do some testing and I'll publish the updated action 🎉

Sounds great! Yeah, in fact that's what I used as basis for this, so it probably makes more sense to unify it in the CLI. The table formatting in there I mainly used to auto-comment the PR with the results. I initially tried formatting it outside using the JSON as source but it was a bit cumbersome and hacky so just went with exposing it already formatted and keeping my build a bit simpler. I found github action jobs and steps to not play very nice with stringified json as parameters hehe.