easystats / workflows

GitHub Actions for {easystats} packages
https://indrajeetpatil.github.io/preventive-r-package-care
Creative Commons Zero v1.0 Universal
8 stars 1 forks source link

Commit README once it it rendered #2

Closed etiennebacher closed 1 year ago

etiennebacher commented 1 year ago

Related to https://github.com/easystats/easystats/issues/278. The GHA renders the README but doesn't commit the change, maybe this is why it isn't automatically updated?

IndrajeetPatil commented 1 year ago

We can try with this. I had adapted this action from here, and they don't do git add either.

https://github.com/r-lib/actions/blob/7dbac86d823c2ead41a503457cde1f13c7891263/examples/render-rmarkdown.yaml#L26-L33

IndrajeetPatil commented 1 year ago

Let's see if it works: https://github.com/easystats/easystats/runs/8152895788?check_suite_focus=true

etiennebacher commented 1 year ago

We can try with this. I had adapted this action from here, and they don't do git add either.

They don't do "git add" because they put the new markdown file in "git commit" whereas we don't:

https://github.com/r-lib/actions/blob/7dbac86d823c2ead41a503457cde1f13c7891263/examples/render-rmarkdown.yaml#L32

IndrajeetPatil commented 1 year ago

Gotcha!

IndrajeetPatil commented 1 year ago

I don't think this is going to work because when we knit the README.Rmd, it typically produces changes to also included plots, etc., and we are committing only the .md file. So, even if this were to work, all side effects produced during rendering will be out of date.

IndrajeetPatil commented 1 year ago

See, e.g., https://github.com/easystats/easystats/runs/8152895788?check_suite_focus=true#step:8:1

etiennebacher commented 1 year ago

So should we use "git add ." instead?

IndrajeetPatil commented 1 year ago

We can try. It will work, but we should just make sure that nothing that we are not creating isn't committed (e.g. /renv folder created by GHA).

IndrajeetPatil commented 1 year ago

Let's check with the new one: https://github.com/easystats/easystats/runs/8153333877?check_suite_focus=true

etiennebacher commented 1 year ago

I tested locally and "git add man/figures/*.png README.md" correctly captures new png in man/figures and the new readme. Are there other special files that are modified in general?

IndrajeetPatil commented 1 year ago

Okay, let's use this more specific approach.

I am trying it here: https://github.com/easystats/easystats/runs/8153418094?check_suite_focus=true

etiennebacher commented 1 year ago

All these tests have to fail because easystats/easystats doesn't use the workflows from easystats/workflows 😅

IndrajeetPatil commented 1 year ago

NOOOOOOOO LMAO, so dumb

etiennebacher commented 1 year ago

I can update the GHA in easystats/easystats

etiennebacher commented 1 year ago

hum, easystats needs a lot of extra packages in the readme (deepdep, miniCRAN, etc.). Maybe we can let the render-readme GHA as before and just add the fix with "git add" there?

IndrajeetPatil commented 1 year ago

I agree. easystats will need to be dealt differently for render README workflow.

etiennebacher commented 1 year ago

Done

etiennebacher commented 1 year ago

Ok so we can add files but the commit cannot be pushed automatically because the branch "main" is protected:

https://github.com/easystats/easystats/runs/8154484139?check_suite_focus=true#step:8:19