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

docs: update README about use with GitHub actions #139

Merged
merged 1 commit into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion chartpress.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")):
Expand Down