Add update-types workflow #1
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 | ||
'on': | ||
schedule: | ||
- cron: '* * * * 7' | ||
workflow_dispatch: {} | ||
permissions: | ||
contents: write | ||
jobs: | ||
update-types: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Update submodules | ||
run: |- | ||
git pull --recurse-submodules | ||
git submodule update --remote --recursive type-generator/lemmy-js-client | ||
- name: Setup python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Build new types | ||
run: python type-generator/main.py | ||
- id: date | ||
name: Get current date | ||
run: echo "::set-output name=date::$(date +'%Y%m%d-%s')" | ||
- name: Create pull request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
branch: update-types/feature/update-types-${{ steps.date.outputs.date }} | ||
name: Update types from source |