We use a gh-pages
branch in our repository to host a static website and frequently commit new information to this branch. Those files often get stale, as we push to a subdirectory per feature branch in the same repository.
The directory structure in my gh-pages
branch is similar to the following:
.
|-- README.md
|-- JIRA-1234-feature
| `-- graph
|-- JIRA-4567-bugfix
| `-- graph
|-- JIRA-7890-branch-name
| `-- testing
I want to remove directories via a GitHub actions for which the last update was more than 5 days ago.
I naively tried to remove them via find /path/to/files* -mtime 5 -exec rm {} ;
, but the operating system obviously uses the clone date as the last modified time.
I also found
git ls-tree -r --name-only HEAD | while read filename; do
echo "$(git log -1 --format="