<p>I have an existing github project. I want to create/add a <code>helm</code> folder to the project to store the helm yaml files. I want to reference this github project/folder to act like a helm repo in my local/dev environment. I know I can add the charts to my local/default helm repo. The use case is if another developer checks out the code in github and he needs to work on the charts then he can run <code>helm install</code> directly from the working folder. The <code>helm.sh</code> website has instructions of adding a <code>gh-pages</code> branch but I am wondering if I can avoid it.</p>

<p>Can I use an existing github project and it via the <code>helm repo add</code> command? </p>

<p>Firstly make sure that you have have fully functional helm repository. The tricky part is to access it as if it was simple HTTP server hosting raw files. Fortunately Github provides such feature using <code>raw.githubusercontent.com</code>. In order for helm to be able to pull files from such repository you need to provide it with Github username and token (Personal Access Token):</p>

<pre><code>&gt; helm repo add - username &lt;your_github_username&gt; - password &lt;your_github_token&gt; my-github-helm-repo 'https://raw.githubusercontent.com/my_organization/my-github-helm-repo/master/'
&gt; helm repo update
&gt; helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
local http://127.0.0.1:8879/charts
my-github-helmrepo https://raw.githubusercontent.com/my_organization/my-github-helm-repo/master/
&gt; helm search my-app
NAME CHART VERSION APP VERSION DESCRIPTION
my-github-helmrepo/my-app-chart 0.1.0 1.0 A Helm chart for Kubernetes
</code></pre>

<p><strong>These are steps for adding new packages to existing repository</strong></p>

<p>If you want to add new package to existing repository simply:</p>

<p><strong>1.</strong> Place new package in your local repository root</p>

<p><strong>2.</strong> Execute: helm repo index .. This will detect new file/folder and make updates.</p>

<p><strong>3.</strong> Commit and push your new package </p>

<p><strong>4.</strong> Finally execute command: <code>helm repo update</code></p>

<p><strong>Security ascpect</strong></p>

<p>It is important to realize where does helm actually store your <a href="https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line" rel="noreferrer">Github token</a>. It is stored as plain text in <code>~/.helm/repository/repositories.yaml</code>. In this case it will be good to generate token with as few permissions as possible.</p>

<p>Take a look here: <a href="https://blog.softwaremill.com/hosting-helm-private-repository-from-github-ff3fa940d0b7" rel="noreferrer">hosting helm private repository</a>.</p>
