Update CMEM Plugin List #5
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: Update CMEM Plugin List | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Runs daily at midnight UTC | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
update-plugin-list: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install and configure poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Install dynamic versioning plugin | |
run: | | |
poetry self add "poetry-dynamic-versioning[plugin]" | |
- name: Run Python script to query PyPI and update package list | |
run: | | |
poetry install | |
poetry run cmem-plugin-index data/plugins_info.json | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
if [[ $(git status --porcelain) ]]; then | |
git add data/plugins_info.json # Stage the JSON file | |
git commit -m "Update CMEM plugin information [$(date --utc)]" | |
git push | |
else | |
echo "No changes to commit" | |
fi |