Fix typo in project list: update "Delete Unscribe email program" to "… #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Owner CI/CD Workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Step 2: Set up Python environment | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12.7' | |
# Step 3: Install dependencies for each project | |
- name: Install dependencies for each project | |
run: | | |
for dir in */; do | |
# Skip non-project folders | |
if [[ "$dir" == ".github/" ]]; then | |
continue | |
fi | |
echo "Processing $dir" | |
if [ -f "$dir/requirements.txt" ]; then | |
echo "Installing dependencies for $dir" | |
pip install -r "$dir/requirements.txt" | |
else | |
echo "No requirements.txt found in $dir" | |
fi | |
done | |
# Step 4: Generate updated README files | |
- name: Generate README files | |
run: | | |
for dir in */; do | |
# Skip non-project folders | |
if [[ "$dir" == ".github/" ]]; then | |
continue | |
fi | |
project_name=$(basename "$dir") | |
readme_file="$dir/README.md" | |
# Create a README with clear instructions | |
echo "# $project_name" > "$readme_file" | |
echo "" >> "$readme_file" | |
echo "## Overview" >> "$readme_file" | |
echo "The **$project_name** project is a part of this repository. It is designed to achieve [brief summary of purpose or functionality]." >> "$readme_file" | |
echo "" >> "$readme_file" | |
echo "## Features" >> "$readme_file" | |
echo "- Describe the main functionality." >> "$readme_file" | |
echo "- Highlight an important aspect of the project." >> "$readme_file" | |
echo "- Easily adaptable to new integrations or projects." >> "$readme_file" | |
echo "" >> "$readme_file" | |
echo "## Getting Started" >> "$readme_file" | |
echo "To run this project, ensure you have Python installed on your system. You can download and install Python from the [official Python website](https://www.python.org/downloads/)." >> "$readme_file" | |
echo "" >> "$readme_file" | |
echo "Next, install the required dependencies by running the following command in your terminal from the project directory:" >> "$readme_file" | |
echo "```bash" >> "$readme_file" | |
echo "pip install -r requirements.txt" >> "$readme_file" | |
echo "```" >> "$readme_file" | |
echo "" >> "$readme_file" | |
echo "---" >> "$readme_file" | |
echo "*📄 README automatically generated by the CI/CD workflow.*" >> "$readme_file" | |
echo "Generated README for $project_name" | |
done | |
# Step 5: Commit and push changes | |
- name: Commit and push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Update Project READMEs" || echo "No changes to commit" | |
git push https://${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }} main |