Skip to content

Commit 653d899

Browse files
author
Diego Luisi
committed
⚡ test pipeline
1 parent 936eac9 commit 653d899

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

.github/workflows/main.yaml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,9 @@ jobs:
133133
# Find all kustomization.yaml files in the apps/ directory
134134
files=$(find apps/ -name "kustomization.yaml")
135135

136-
# Prepare output file
137-
output_file="versions.md"
138-
echo "| Tools | Version | Repo | Status |" > $output_file
139-
echo "| :--------------: | :-----: | :---: | :------: |" >> $output_file
136+
# Prepare output content
137+
output_content="| Tools | Version | Repo | Status |\n"
138+
output_content+="| :--------------: | :-----: | :---: | :------: |\n"
140139

141140
# Loop through each file
142141
for file in $files; do
@@ -149,33 +148,35 @@ jobs:
149148
if [ "$name" != "null" ] && [ "$version" != "null" ]; then
150149
# Check if repo is null
151150
if [ "$repo" != "null" ]; then
152-
# Print the name, version, repo, and deployed status
153-
echo "| $name | $version | $repo | ✅ |" >> $output_file
151+
# Append the name, version, repo, and deployed status to output_content
152+
output_content+="| $name | $version | $repo | ✅ |\n"
154153
else
155-
# Print the name, version, and deployed status without repo
156-
echo "| $name | $version | - | ✅ |" >> $output_file
154+
# Append the name, version, and deployed status without repo to output_content
155+
output_content+="| $name | $version | - | ✅ |\n"
157156
fi
158157
fi
159158
done
160159

161-
# Sort the output file
162-
sort -u -k 2 $output_file -o $output_file
160+
# Sort the output content
161+
output_content=$(echo -e "$output_content" | sort -u -k 2)
163162

164-
# Display the output
165-
cat $output_file > Tooling.md
163+
# Replace the specific section in Tooling.md with the new content
164+
sed -i '/| *Tools *| *Version *| *Repo *| *Status *|/,$d' Tooling.md
165+
echo -e "$output_content" >> Tooling.md
166166

167-
- name: Commit New Tooling.md 📝
167+
- name: Commit and Push Changes 📝
168168
run: |
169169
if [[ $(git diff) ]];
170170
then
171+
git config --global user.name 'github-actions[bot]'
172+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
171173
git add Tooling.md
172174
git commit -m "[ci skip] :robot: [github actions actor] - update Tooling.md"
173175
git push
174176
else
175177
echo "nothing to do!!!"
176178
fi
177179

178-
179180
notify:
180181
uses: devxp-tech/.github/.github/workflows/notify.yaml@main
181182
if: always()

version.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Find all kustomization.yaml files in the apps/ directory
44
files=$(find apps/ -name "kustomization.yaml")
55

6-
# Print the header
7-
echo "| Tools | Version | Repo | Status |"
8-
echo "| :--------------: | :-----: | :---: | :------: |"
6+
# Prepare output content
7+
output_content="| Tools | Version | Repo | Status |\n"
8+
output_content+="| :--------------: | :-----: | :---: | :------: |\n"
99

1010
# Loop through each file
1111
for file in $files; do
@@ -18,11 +18,18 @@ for file in $files; do
1818
if [ "$name" != "null" ] && [ "$version" != "null" ]; then
1919
# Check if repo is null
2020
if [ "$repo" != "null" ]; then
21-
# Print the name, version, repo, and deployed status
22-
echo "| $name | $version | $repo | ✅ |"
21+
# Append the name, version, repo, and deployed status to output_content
22+
output_content+="| $name | $version | $repo | ✅ |\n"
2323
else
24-
# Print the name, version, and deployed status without repo
25-
echo "| $name | $version | - | ✅ |"
24+
# Append the name, version, and deployed status without repo to output_content
25+
output_content+="| $name | $version | - | ✅ |\n"
2626
fi
2727
fi
28-
done | sort -u -k 2
28+
done
29+
30+
# Sort the output content
31+
output_content=$(echo -e "$output_content" | sort -u -k 2)
32+
33+
# Replace the specific section in Tooling.md with the new content
34+
sed -i '/| *Tools *| *Version *| *Repo *| *Status *|/,$d' Tooling.md
35+
echo -e "$output_content" >> Tooling.md

0 commit comments

Comments
 (0)