Skip to content

Save commit

Save commit #14

name: Update Homepage
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate Homepage
run: |
echo "# SkunkWorks" > README.md
echo "## Projects" >> README.md
echo "| Project Name | Description | Status | Contributors | Technology | Tags |" >> README.md
echo "|--------------|-------------|--------|--------------|------------|------|" >> README.md
for file in projects/*.md; do
if [[ $file == "projects/_template.md" ]]; then
continue
fi
title=$(grep -m 1 '^title:' $file | cut -d '"' -f 2)
description=$(grep -m 1 '^description:' $file | cut -d '"' -f 2)
status=$(grep -m 1 '^status:' $file | cut -d '"' -f 2)
contributors=$(grep -A 1 '^contributors:' $file | tail -n +2 | grep -v '^---' | sed 's/ - //g' | paste -sd '<br>' -)
tech=$(grep -A 1 '^technology:' $file | tail -n +2 | grep -v '^---' | sed 's/ - //g' | paste -sd '<br>' -)
tags=$(grep -A 1 '^tags:' $file | tail -n +2 | grep -v '^---' | sed 's/ - //g' | paste -sd '<br>' -)
if [[ $status == "Completed" ]]; then
status_icon="✅"
elif [[ $status == "Ongoing" ]]; then
status_icon="🟡"
elif [[ $status == "Abandoned" ]]; then
status_icon="❌"
else
status_icon=$status
fi
echo "| [$title]($file) | $description | $status_icon | $contributors | $tech | $tags |" >> README.md
done
- name: Commit changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add README.md
git commit -m "Automatically update homepage with project details and tech stack"
git push