Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD[#93]:Using AWS service_name for the README hyperlink #104

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/generate-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,45 @@ jobs:
run: sudo apt-get install jq -y

- name: Generate Content

run: |
json=$(cat services.json)
services=$(echo "$json" | jq -r '.services[] | @base64')

echo "Clean up the previous content under 'Service introduction'"
sed -i '/# Service introduction/,$ {/# Service introduction/!d}' README.md

for service in $services; do
_jq() {
echo ${service} | base64 --decode | jq -r ${1}
}
folder=$(_jq '.service_folder_name')
url=$(_jq '.service_url')
youtube_url=$(_jq '.service_youtube_url')
service_name=$(_jq '.service_name')

if [ ! -d "$folder" ]; then
mkdir "$folder"
echo "Folder created: $folder"
else
echo "Folder already exists: $folder"
fi

echo "# $service_name" > "$folder/README.md"
# Update the service README.md content
echo -e "- Official AWS URL: $url" >> "$folder/README.md"
echo -e "- Official YouTube Introduction: $youtube_url" >> "$folder/README.md"
echo "Check the new content in $folder/README.md"
cat "$folder/README.md"

# Update the README.md content
echo -e "- [$service_name](./$folder/README.md)" >> README.md
done
echo "Check the new content in README.md"
cat README.md

run: sh generate-content.sh


- name: Commit changes
run: |
Expand Down