Skip to content

Commit

Permalink
testing additional info
Browse files Browse the repository at this point in the history
  • Loading branch information
Rein-Vanbelleghem committed Mar 14, 2024
1 parent bfe55c5 commit 13056f8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/release_helmcharts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,16 @@ jobs:
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Merge site.yaml into index.yaml
run: python3 add_additional_info.py

- name: Commit and push changes
run: |
git add index.yaml
git commit -m "Update index.yaml with custom fields from site.yaml"
git push
22 changes: 22 additions & 0 deletions add_additional_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import yaml
import os

def merge_site_into_index(chart_dir, index_file):
index_data = {}
with open(index_file, 'r') as index:
index_data = yaml.safe_load(index)

for chart in index_data['entries']:
site_file = os.path.join(chart_dir, chart, 'site.yaml')
if os.path.exists(site_file):
with open(site_file, 'r') as site:
site_data = yaml.safe_load(site)
for version in index_data['entries'][chart]:
version.update(site_data)

with open(index_file, 'w') as index:
yaml.dump(index_data, index, default_flow_style=False)

chart_dir = './charts' # Adjust this path if necessary
index_file = 'index.yaml'
merge_site_into_index(chart_dir, index_file)
1 change: 1 addition & 0 deletions charts/example/site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
image_url: "https://www.nginx.com/wp-content/uploads/2021/08/NGINX-Part-of-F5-horiz-black-type-1.svg"

0 comments on commit 13056f8

Please sign in to comment.