Update examples API #744
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 examples API | |
on: | |
schedule: | |
- cron: '00 17 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fixup git permissions | |
# https://github.com/actions/checkout/issues/766 | |
shell: bash | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- run: pip install -r requirements.txt | |
- name: Add components status | |
run: gh project item-list 32 --owner italia --format json --limit 100 | jq > api/components_status.json | |
env: | |
GH_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} | |
- run: python extract_examples.py | |
- name: Setup Git | |
uses: fregante/setup-git-user@v1 | |
- name: Add API stuff | |
run: | | |
git add api/ | |
git commit -m "chore: update examples api" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
title: "chore: update examples api" | |
branch: feature/update-examples-api |