OCHA-DAP / hdx-signals

HDX Signals
https://un-ocha-centre-for-humanitarian.gitbook.io/hdx-signals/
GNU General Public License v3.0
5 stars 0 forks source link

Update PROMPTS.md when prompts text files are changed #208

Closed caldwellst closed 1 month ago

caldwellst commented 2 months ago

Created a PROMPTS.md file that is automatically updated when changes are made to any of the prompts .txt files in the repository. You can see it run extremely fast when nothing necessary by only running if specific files are changed: https://github.com/OCHA-DAP/hdx-signals/actions/runs/9907412695/job/27371042315.

Here is the latest attempt to see if I can successfully update the file: https://github.com/OCHA-DAP/hdx-signals/actions/runs/9907451636/job/27371174239?pr=208.

However, wondering how this integrates with GitBook? I know you've previously looked into this. Thoughts?

caldwellst commented 2 months ago

I have finally gotten the GitHub action to succeed! Required changing github.ref to github.head_ref in the yaml file because we are trying to run this on a PR. https://github.com/OCHA-DAP/hdx-signals/actions/runs/9936993212/job/27446384421

caldwellst commented 1 month ago

And now moved to new actions workflow that properly detects if files are changed within the PR. Previously, since the files had been changed once in the PR, it was always running. Now, it's only if on that new commit additional changes have been made. https://github.com/OCHA-DAP/hdx-signals/actions/runs/9937735277/job/27448705391

caldwellst commented 1 month ago

And lastly, tested that the new change detection works by editing the prompt for JRC ASAP. It does work! https://github.com/OCHA-DAP/hdx-signals/actions/runs/9937809175

caldwellst commented 1 month ago

Fixed all your comments! Now it runs if any changes are detected in either the publish_prompts.R script or the .txt files. There is also a comment int he markdown to not edit the output. Things look good on GitBook!