From 625fc4ad5b9d3a5f06315117bd31ec3e1f624190 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 28 Jul 2021 08:45:54 +0200 Subject: [PATCH] docs: update README about use with GitHub actions --- README.md | 21 ++++++++++++--------- chartpress.py | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 444e299..b3219ba 100644 --- a/README.md +++ b/README.md @@ -224,20 +224,23 @@ charts: ### Shallow clones -Chartpress detects the latest commit which changed a directory or file when +Chartpress detects the latest commit that changed a directory or file when determining the version and tag to use for charts and images. This means that shallow clones should not be used because if the last commit that changed a -relevant file is outside the shallow commit range, the wrong tag will be -assigned. +relevant file is outside the shallow commit range, the wrong chart version and +image tag will be assigned. -TravisCI uses a clone depth of 50 by default, which can result in incorrect -image tagging. You can [disable this shallow clone -behavior](https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth) -in your `.travis.yml`: +#### Avoiding shallow clones with GitHub Actions + +GitHub Workflow's commonly used GitHub Action called actions/checkout have a +clone clone-depth of 1 by default, configure it to make a full clone instead. ```yaml -git: - depth: false +steps: + - uses: actions/checkout@v2 + with: + # chartpress need the git branch's tags and commits + fetch-depth: 0 ``` ### Command caching diff --git a/chartpress.py b/chartpress.py index 6273080..6301dc3 100755 --- a/chartpress.py +++ b/chartpress.py @@ -800,7 +800,7 @@ def publish_pages( _check_call(["git", "checkout", "gh-pages"], cwd=checkout_dir, echo=True) # check if a chart with the same name and version has already been published. If - # there is, the behaviour depends on `-force-publish-chart` + # there is, the behaviour depends on `--force-publish-chart` # and chart_version and make a decision based on the --force-publish-chart # flag if that is the case, but always log what's done if os.path.isfile(os.path.join(checkout_dir, "index.yaml")):