diff options
author | Gereon Kremer <nafur42@gmail.com> | 2021-08-26 14:03:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 14:03:05 -0700 |
commit | 8915e3234871e56eb9fa1c188f89a8d825dc10e8 (patch) | |
tree | 15f047cec14e2e0b2eb23ba2febf7dd62eeb808f | |
parent | 21fa888738ea77e4436ef164c184e61683a55fb5 (diff) |
Fix a subtle issues with squashing the docs-ci history (#7075)
The docs-cleanup job squashes all commits from the docs-ci repository that are older than one month. The current solution to retrieve the newest commit older than this one month erroneously relied on the commit date. As the script cherry-picks all newer commits, it should rather use the author date, though. Unfortunately, rev-list does not support filtering by author date, hence we use awk now...
-rw-r--r-- | .github/workflows/docs_cleanup.yml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/.github/workflows/docs_cleanup.yml b/.github/workflows/docs_cleanup.yml index 1bb48ff08..36fd3488b 100644 --- a/.github/workflows/docs_cleanup.yml +++ b/.github/workflows/docs_cleanup.yml @@ -45,7 +45,8 @@ jobs: run: | cd target first=`git rev-list --max-parents=0 HEAD` - last=`git rev-list --until=1.month.ago -n1 HEAD` + cutoff=`date -d "-1 month" +%Y-%m-%d` + last=`git log --pretty='%as %H' | awk -v cutoff=$cutoff '$1 < cutoff { print $2 }' | head -n1` if [ -n "$last" ]; then git checkout $last ts=`git log -1 --format=%ct` |