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

Root directory chart #37

Open
tylerauerbeck opened this issue Jan 20, 2023 · 2 comments · May be fixed by #38
Open

Root directory chart #37

tylerauerbeck opened this issue Jan 20, 2023 · 2 comments · May be fixed by #38

Comments

@tylerauerbeck
Copy link

Does this action support packaging charts that are at the root of the directory? I'm currently seeing Error: need at least one argument, the path to the chart whenever I set charts_dir: .

@tylerauerbeck
Copy link
Author

I have a feeling the answer is currently probably a no because of the locate function only looking at type -d

locate() {
    for dir in $(find "${CHARTS_DIR}" -type d -mindepth 1 -maxdepth 1); do
      if [[ -f "${dir}/Chart.yaml" ]]; then
        CHARTS+=("${dir}")
        echo "Found chart directory ${dir}"
      else
        echo "Ignoring non-chart directory ${dir}"
      fi
    done
}

I went ahead and switched locate to do something like:

locate() {
  if [[ "${CHARTS_DIR}" == "." ]]; then
    echo "Chart directory set to repository root. Treating everything as part of the chart."
    CHARTS+=(".")
  else
    for dir in $(find "${CHARTS_DIR}" -type d -mindepth 1 -maxdepth 1); do
      if [[ -f "${dir}/Chart.yaml" ]]; then
        CHARTS+=("${dir}")
        echo "Found chart directory ${dir}"
      else
        echo "Ignoring non-chart directory ${dir}"
      fi
    done
  fi
}

And this now works as expected. Let me know if that is something that you would like to support and I can PR this in.

In the interim, if folks are looking for that functionality, you can go ahead and use tylerauerbeck/helm-gh-pages@main in your workflows.

@tylerauerbeck tylerauerbeck linked a pull request May 1, 2023 that will close this issue
@t3mi
Copy link
Contributor

t3mi commented Sep 25, 2023

FYI specifying charts_dir: ../ could be used as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants