Regenerate Python library snippets #10
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: Regenerate Python library snippets | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
jobs: | |
generate_snippets: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
pip install jinja2 | |
- name: Delete folder | |
run: | | |
rm -rf meraki/sdk/python | |
- name: Download newest generator | |
run: | | |
wget https://github.com/meraki/dashboard-api-python/raw/main/generator/generate_snippets.py | |
- name: Regenerate Python Library snippets | |
run: | | |
python generate_snippets.py | |
- name: Move snippets | |
run: | | |
mv code_snippets meraki/sdk/python | |
- name: Delete generator | |
run: | | |
rm generate_snippets.py | |
- name: Commit changes to new branch | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: GitHub Action | |
author_email: [email protected] | |
message: Automatically regenerated Python library snippets. | |