Skip to content

sync-openapi

sync-openapi #4

Workflow file for this run

name: sync-openapi
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- name: Validate sync secret
env:
JUSTSERPAPI_OPENAPI_API_KEY: ${{ secrets.JUSTSERPAPI_OPENAPI_API_KEY }}
run: |
if [ -z "${JUSTSERPAPI_OPENAPI_API_KEY}" ]; then
echo "Missing JUSTSERPAPI_OPENAPI_API_KEY secret" >&2
exit 1
fi
- name: Refresh OpenAPI and generated runtime
env:
JUSTSERPAPI_OPENAPI_API_KEY: ${{ secrets.JUSTSERPAPI_OPENAPI_API_KEY }}
run: python3 scripts/sdkctl.py sync
- name: Run control-plane unit tests
run: python3 -m unittest discover -s scripts/tests -v
- name: Run Ruby tests
run: bundle exec rake test
- name: Build gem
run: gem build justserpapi.gemspec
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
branch: automation/openapi-sync
commit-message: "chore: sync OpenAPI-generated Ruby SDK"
title: "chore: sync OpenAPI-generated Ruby SDK"
body: |
Automated OpenAPI sync.
- refreshed the raw upstream OpenAPI document
- regenerated the normalized codegen spec
- updated the committed generated Ruby runtime
labels: |
automation
openapi