@@ -133,10 +133,9 @@ jobs:
133
133
# Find all kustomization.yaml files in the apps/ directory
134
134
files=$(find apps/ -name "kustomization.yaml")
135
135
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"
140
139
141
140
# Loop through each file
142
141
for file in $files; do
@@ -149,33 +148,35 @@ jobs:
149
148
if [ "$name" != "null" ] && [ "$version" != "null" ]; then
150
149
# Check if repo is null
151
150
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"
154
153
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"
157
156
fi
158
157
fi
159
158
done
160
159
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)
163
162
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
166
166
167
- - name: Commit New Tooling.md 📝
167
+ - name: Commit and Push Changes 📝
168
168
run: |
169
169
if [[ $(git diff) ]];
170
170
then
171
+ git config --global user.name 'github-actions[bot]'
172
+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
171
173
git add Tooling.md
172
174
git commit -m "[ci skip] :robot: [github actions actor] - update Tooling.md"
173
175
git push
174
176
else
175
177
echo "nothing to do!!!"
176
178
fi
177
179
178
-
179
180
notify:
180
181
uses: devxp-tech/.github/.github/workflows/notify.yaml@main
181
182
if: always()
0 commit comments