GitHub Action for updating Clojure Events failing
The last event on the [Clojure community events page](https://clojure.org/community/events) is from last October, but there's been quite a few events on the [Zulip events feed](https://clojurians.zulipchat.com/#narrow/channel/262224-events) since then.
I suspect this is due to an error in the [publish-events.yml](https://github.com/clojure/clojure-site/blob/4505a8ea296365c0e98e8f23d664792adc91ef7a/.github/workflows/publish-events.yml#L42) GitHub Action. The action checks for the word "modified" in git status, but if only new files are added, this doesn't occur.
Instead, may I suggest using `git diff --quiet --cached` to check to see if there's any staged differences after running `git add content/events`. This will return an exit code of 0 only if there are no differences, so we can use the inverse to check to see if there should be an update.
```bash
git add content/events
if ! git diff --quiet --cached
then
git commit -m 'update events'
git push
fi
```
关闭于 2025-02-19 1 条评论