Skip to content

Commit 725ae15

Browse files
author
Diego Luisi
committed
⚡ test pipeline
1 parent 6a5b610 commit 725ae15

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

.github/workflows/main.yaml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,62 @@ jobs:
115115
# - datree-check
116116
- trivy-scan
117117

118+
tools-version:
119+
runs-on: ubuntu-latest
120+
121+
steps:
122+
- name: Checkout Repository
123+
uses: actions/checkout@v4
124+
125+
- name: Install yq
126+
run: |
127+
sudo add-apt-repository -y ppa:rmescandon/yq
128+
sudo apt-get update
129+
sudo apt-get install -y yq
130+
131+
- name: Find and Process kustomization.yaml Files
132+
run: |
133+
# Find all kustomization.yaml files in the apps/ directory
134+
files=$(find apps/ -name "kustomization.yaml")
135+
136+
# Prepare output file
137+
output_file="kustomization_info.md"
138+
echo "| Tools | Version | Repo | Status |" > $output_file
139+
echo "| :--------------: | :-----: | :---: | :------: |" >> $output_file
140+
141+
# Loop through each file
142+
for file in $files; do
143+
# Get the name, version, and repo from the kustomization.yaml file using yq
144+
name=$(yq eval '.helmCharts[0].name' $file)
145+
version=$(yq eval '.helmCharts[0].version' $file)
146+
repo=$(yq eval '.helmCharts[0].repo' $file)
147+
148+
# Check if both name and version are not null
149+
if [ "$name" != "null" ] && [ "$version" != "null" ]; then
150+
# Check if repo is null
151+
if [ "$repo" != "null" ]; then
152+
# Print the name, version, repo, and deployed status
153+
echo "| $name | $version | $repo | ✅ |" >> $output_file
154+
else
155+
# Print the name, version, and deployed status without repo
156+
echo "| $name | $version | - | ✅ |" >> $output_file
157+
fi
158+
fi
159+
done
160+
161+
# Sort the output file
162+
sort -u -k 2 $output_file -o $output_file
163+
164+
# Display the output
165+
cat $output_file
166+
167+
- name: Upload kustomization Info
168+
uses: actions/upload-artifact@v3
169+
with:
170+
name: kustomization-info
171+
path: kustomization_info.md
172+
173+
118174
notify:
119175
uses: devxp-tech/.github/.github/workflows/notify.yaml@main
120176
if: always()
@@ -125,5 +181,6 @@ jobs:
125181
- kube-linter
126182
- secret-find
127183
# - datree-check
128-
- quality-gate
184+
# - quality-gate
185+
- tools-version
129186
- trivy-scan

0 commit comments

Comments
 (0)