Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action which updates the README for me when I add a new TIL #1

Closed
simonw opened this issue Apr 19, 2020 · 9 comments
Closed
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Apr 19, 2020

I want the README to link to all of the TILs.

@simonw simonw added the enhancement New feature or request label Apr 19, 2020
@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

I'm going to build and deploy a SQLite database too.

@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

I have the script now. Next step: build it into action which then pushes a commit to the repo with the updated README.

Need to make sure that the commit triggered by the action doesn't cause a new action run.

simonw added a commit that referenced this issue Apr 19, 2020
simonw added a commit that referenced this issue Apr 19, 2020
@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

It worked! 897ac31

simonw added a commit that referenced this issue Apr 19, 2020
@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

Last test: add a new TIL and see if it updates the README and deploys to Now.

@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

89e810e didn't update the README for some reason.

https://github.com/simonw/til/runs/599796757?check_suite_focus=true

simonw added a commit that referenced this issue Apr 19, 2020
simonw added a commit that referenced this issue Apr 19, 2020
@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

This is weird: https://github.com/simonw/til/runs/599813070?check_suite_focus=true

diff --git a/README.md b/README.md
index b7c3739..d186d07 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@ My Today I Learned snippets. Inspired by [jbranchaud/til](https://github.com/jbr
 * [Only run GitHub Action on push to master](https://github.com/simonw/til/blob/master/github-actions/only-master.md) - 2020-04-19
 * [Dump out all GitHub Actions context](https://github.com/simonw/til/blob/master/github-actions/dump-context.md) - 2020-04-19
 * [Set environment variables for all steps in a GitHub Action](https://github.com/simonw/til/blob/master/github-actions/set-environment-for-all-steps.md) - 2020-04-19
+* [Commit a file if it changed](https://github.com/simonw/til/blob/master/github-actions/commit-if-file-changed.md) - 2020-04-19
 
 ## python
 
Everything up-to-date

Why does it say Everything up-to-date when git diff clearly shows changes?

@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

Oh! It's because I ran git add before that git diff:

        git add README.md
        git diff --quiet || git commit -m "Updated README"
        git push

simonw added a commit that referenced this issue Apr 19, 2020
@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

Still not quite working right. https://github.com/simonw/til/runs/599821875?check_suite_focus=true broke:

Install_datasette-render-markdown_·_simonw_til_f5df21e

simonw added a commit that referenced this issue Apr 19, 2020
@simonw
Copy link
Owner Author

simonw commented Apr 19, 2020

It's working now.

@simonw simonw closed this as completed Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant