Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/api: generate PR if API changes #623

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/generate_api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: check_and_regenerate_api

on:
workflow_dispatch:
schedule:
- cron: "0 7 * * *" # everyday at 7 AM

jobs:
check_changes_and_create_pr:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for changes
id: check_changes
run: |
make x-cmd
git diff --quiet || echo "changes_detected=true" >> $GITHUB_OUTPUT

- name: Create PR
if: steps.check_changes.outputs.changes_detected
uses: peter-evans/create-pull-request@v6
with:
title: "api: regenerate from new API spec"
body: "New changes have appeared in the API spec and the `exo api` commands have been regenerated."
branch: generate-exo-api
delete-branch: true
base: master
Loading