Skip to content

Commit

Permalink
Enhance daoip5 (#30)
Browse files Browse the repository at this point in the history
* update stellar name

* add error handling, conditional commits and PR generation
  • Loading branch information
Rashmi-278 authored Nov 5, 2024
1 parent 7079f1c commit 7d2c3d6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/daoip5-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,33 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r daoip-5/requirements.txt
- name: Generate JSON files
id: generate_files
run: |
# Detecting the updated/added folder in the funders directory
FOLDER_PATH=$(git diff --name-only HEAD^ HEAD | grep '^data/funders' | head -1 | xargs dirname)
FOLDER_PATH=$(git diff --name-only HEAD^ HEAD | grep '^data/funders' | head -1 | xargs dirname || true)
if [ -z "$FOLDER_PATH" ]; then
echo "No changes detected in funders directory. Exiting."
exit 0
fi
# Running the main.py script with the detected path
python3 daoip-5/scripts/main.py --path "./$FOLDER_PATH"
- name: Commit generated files
- name: Check for changes and commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add daoip-5/json
git commit -m "Auto-generated files for new/updated folder"
if [ -n "$(git status --porcelain)" ]; then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add daoip-5/json
git commit -m "Auto-generated files for new/updated folder"
else
echo "No changes to commit."
exit 0
- name: Push changes and create PR
if: success() && steps.generate_files.outputs.FOLDER_PATH != ''
uses: peter-evans/create-pull-request@v5
with:
commit-message: Auto-generated DAOIP-5 files for new/updated folder
Expand Down
1 change: 1 addition & 0 deletions daoip-5/scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PyYAML==6.0
4 changes: 2 additions & 2 deletions data/funders/stellar/stellar_development_foundation.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 1
name: Stellar Development Foundation
name: Stellar
type: Foundation
display_name: Stellar Development Foundation
display_name: Stellar
grant_pools:
- name: scf-1
- name: scf-2
Expand Down

0 comments on commit 7d2c3d6

Please sign in to comment.