Skip to content

Commit 22cfd48

Browse files
authored
Merge pull request #1501 from porter-dev/george/por-3462-prevent-external-secrets-crds-from-being-uninstalled-during
fix: add new workflow to pull external-secrets charts directly from tar file
2 parents 3a5f3b5 + e733e7f commit 22cfd48

File tree

3 files changed

+91
-5
lines changed

3 files changed

+91
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 'Sync Helm chart from release using tar file'
2+
description: 'Download and sync a Helm chart from a release URL'
3+
4+
inputs:
5+
chart_url:
6+
description: 'Full URL to the chart .tgz file'
7+
required: true
8+
target_directory:
9+
description: 'Directory within the current repo where we would like to copy the files'
10+
required: true
11+
github_token:
12+
description: 'Github token to use for API calls'
13+
required: true
14+
chart_name:
15+
description: 'Name of the chart for PR title and branch name'
16+
required: true
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Create temp directory
22+
shell: bash
23+
run: mkdir -p /tmp/helm-charts
24+
- name: Download Helm chart
25+
shell: bash
26+
run: |
27+
echo "Downloading chart from: ${{ inputs.chart_url }}"
28+
curl -L -o /tmp/helm-charts/chart.tgz "${{ inputs.chart_url }}"
29+
- name: Extract chart
30+
shell: bash
31+
run: |
32+
cd /tmp/helm-charts
33+
tar -xzf chart.tgz
34+
- name: Sync to target directory
35+
shell: bash
36+
run: |
37+
# Create target directory if it doesn't exist
38+
mkdir -p ${{ inputs.target_directory }}
39+
40+
# Copy contents to directory
41+
rsync -av --delete --cvs-exclude /tmp/helm-charts/${{ inputs.chart_name }}/ ${{ inputs.target_directory }}/
42+
43+
# Add to vendored-charts
44+
echo "${{ inputs.target_directory }}" >> vendored-charts
45+
sort -uo vendored-charts vendored-charts
46+
47+
- name: Create PR
48+
uses: peter-evans/create-pull-request@v5
49+
with:
50+
token: ${{ inputs.github_token }}
51+
add-paths: |
52+
vendored-charts
53+
${{ inputs.target_directory }}
54+
title: "Sync: ${{ inputs.chart_name }} from tar file"
55+
branch: "sync-${{ inputs.chart_name }}-release"
56+
57+
- name: Cleanup
58+
shell: bash
59+
run: rm -rf /tmp/helm-charts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Sync remote charts in PR using tar files'
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- '.github/workflows/sync-remote-helm-charts-using-tar-files.yaml'
8+
workflow_dispatch:
9+
10+
jobs:
11+
sync-chart-using-tar-file:
12+
strategy:
13+
matrix:
14+
charts:
15+
- chart_url: https://github.com/external-secrets/external-secrets/releases/download/helm-chart-0.10.3/external-secrets-0.10.3.tgz
16+
target_directory: addons/external-secrets
17+
chart_name: external-secrets
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout porter-charts
24+
uses: actions/checkout@v4
25+
26+
- name: Sync chart from tar file
27+
uses: ./.github/actions/sync-remote-directory-using-tar-file
28+
with:
29+
chart_url: ${{ matrix.charts.chart_url }}
30+
target_directory: ${{ matrix.charts.target_directory }}
31+
chart_name: ${{ matrix.charts.chart_name }}
32+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sync-remote-helm-charts.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ jobs:
127127
remote_directory: charts/karpenter
128128
target_directory: addons/karpenter-aws
129129
tag: v1.0.2
130-
- remote_owner: external-secrets
131-
remote_repository: external-secrets
132-
remote_directory: deploy/charts/external-secrets
133-
target_directory: addons/external-secrets
134-
tag: helm-chart-0.10.3
135130

136131
permissions:
137132
contents: write

0 commit comments

Comments
 (0)