rootEnginear / gh-issues-cms

Using GitHub issues as a CMS with Astro 🚀
https://rootenginear.github.io/gh-issues-cms/
6 stars 0 forks source link

Can anyone publish? #2

Closed jsjoeio closed 1 year ago

jsjoeio commented 1 year ago

If I write this here and then you rebuild your site, won't it publish my article?

rootEnginear commented 1 year ago

No, the published issues must have the state:published label.

This is done by specify in GraphQL query that we only want issue with only state:published label

https://github.com/rootEnginear/gh-issues-cms/blob/5574636989b408b28c57094e325bd65849930814/src/utils/fetch.ts#L21-L31

Even if the action is triggering every time the issue is opened, we can use the condition to skip the build

https://github.com/rootEnginear/gh-issues-cms/blob/5574636989b408b28c57094e325bd65849930814/.github/workflows/build.yaml#L39-L41

This repo is inspired by https://github.com/renatorib/github-blog which you should check it out. Currently this repo is only a proof of concept, and in many ways needs a lot of work to be functioning well enough (like markdown formatting, comments, opengraph image ganaration, etc.). Thank you for your interest in this repo. ❤️

jsjoeio commented 1 year ago

Oh I didn't even realize that! Wow, thank you for the detailed response and the suggestions! :D