Skip to content

Merge remote-tracking branch 'origin/master' into feature/auto_plugin… #4

Merge remote-tracking branch 'origin/master' into feature/auto_plugin…

Merge remote-tracking branch 'origin/master' into feature/auto_plugin… #4

name: Auto-update plugin card on website
on:
workflow_dispatch:
push:
branches: [feature/auto_plugininfo_on_website]
paths:
- '.github/workflows/update_plugininfo.yml'
- 'scripts/update_plugininfo.py'
jobs:
update-card:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo (plugin source picked automatically)
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Python dependencies
run: pip install requests pyyaml
- name: Get repo name (lowercase) and run script
run: |
REPO_NAME=$(basename "${{ github.repository }}") # e.g., Scatterplot
REPO_NAME_LC="${REPO_NAME,,}" # scatterplot
echo "Running from repo: $REPO_NAME"
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV # export for later steps
echo "REPO_NAME_LC=$REPO_NAME_LC" >> $GITHUB_ENV
python scripts/update_plugininfo.py "$REPO_NAME"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Clone manivaultstudio.github.io (feature branch)
run: |
git clone --branch ft/test-plugin-push \
https://x-access-token:${{ secrets.TEST_GH_PAGES_DEPLOY_TOKEN }}@github.com/ManiVaultStudio/manivaultstudio.github.io.git \
target-repo
cp "${REPO_NAME_LC}.md" target-repo/_plugins/
if [ -f "target-repo/_plugins/${REPO_NAME_LC}.md" ]; then
echo "Target file ${REPO_NAME_LC}.md found in _plugins/"
else
echo "Target file ${REPO_NAME_LC}.md not found in _plugins/"
exit 1
fi # quick sanity
- name: Commit and push
run: |
cd target-repo
git config user.name "ManiVault Bot"
git config user.email "bot@manivault.studio"
git add "_plugins/${REPO_NAME_LC}.md"
git commit -m "🔄 Auto-update plugin card from ${REPO_NAME}"
git push origin ft/test-plugin-push