Closed pabloromeo closed 2 years ago
+1 @pabloromeo i am too facing the same issue.
@sinedied Even though the posting/updating job is successful, the GHA fails with this error message. This is a great tool would be nice if you can help in fixing this ( i don't know how to fix, otherwise if have send you thee PR)
Thanks for reporting this, I'll have a look. I'll have to catch this specific use case to avoid throwing an error
Hey! Since I didn't know if you were still maintaining this, I forked and fixed it here, in this commit: https://github.com/cloudx-labs/publish-devto/commit/0235a3f1238c369904ac72026bddbe6a071ef0a2
I solved it by evaluating the result of git status prior to the commit, to doing it when the workdir is clean.
In that repo I also added support for dry-run in the github action, and added output parameters so other actions can do stuff with the summary of actions taken. For example, in my usage, I'm using an output summary of a dry-run which I post as a comment in the PR, to inform of the changes that would be published.
@pabloromeo That's great! Could you submit a PR with your change? I'll gladly merge it 🙂
Sure thing, here you go: https://github.com/sinedied/publish-devto/pull/20
@pabloromeo The GitHub Action is updated (still under v2 tag), and I also updated the template repo to include your changes and ideas with PR reviews: https://github.com/sinedied/devto-github-template/blob/main/.github/workflows/publish.yml 🙂
In the event of updating content for a draft that has already been previously created and uplodaed by this action, the git commit action fails, since there are no local changes to commit.
For example:![image](https://user-images.githubusercontent.com/41338020/150376222-1115d55c-66eb-49a2-b6da-131013e182ed.png)
I'm guessing prior to issuing the commit it should check if the working tree is clean and not run it.