Skip to content

Feature/11 add workflow to update sdk (#12) #2

Feature/11 add workflow to update sdk (#12)

Feature/11 add workflow to update sdk (#12) #2

name: Update SDK
# Define the events that trigger the workflow
on:
push:
branches:
- main
paths:
- "api/**"
jobs:
update_api:
# Define the OS and environment the job will run on
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the first repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Checkout the second repository
- name: Checkout second repository
uses: actions/checkout@v4
with:
repository: wordlift/python-client
path: "./python-client"
# step 3: Patch middleware api specification
- name: Apply patch to middleware.yaml
run: git apply ./patch/fix_middleware_spec.patch
- name: Copy content from current repo to another repo
run: cp api/* python-client/api
# Step 4: Commit and push the changes to the repository
- name: Commit and push changes
run: |
cd python-client
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Update api"
git push origin main