Skip to content

Commit

Permalink
v3: automate regeneration when spec changes (#643)
Browse files Browse the repository at this point in the history
Everyday at 7 AM we trigger a GitHub Action that runs `make generate`.
This will download the exoscale API spec and try to regenerate egoscale
v3. If there are changes, we create a PR with those changes.
  • Loading branch information
sauterp authored Jul 16, 2024
1 parent 740d7b6 commit 0aca010
Show file tree
Hide file tree
Showing 5 changed files with 15,981 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/generate_v3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: check_and_regenerate_v3

on:
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 generate
git diff --quiet || echo "::set-output name=changes_detected::true"
- name: Create PR
if: steps.check_changes.outputs.changes_detected
uses: peter-evans/create-pull-request@v6
with:
title: "v3: regenerate from new API spec"
body: "New changes have appeared in the API spec and egoscale v3 has been regenerated."
branch: generate-v3
delete-branch: true
base: master
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ test/
listApis.json
public-api.json
release
v3/generator/source.yaml
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

Unreleased
----------

- v3: automate regeneration when spec changes #643

3.1.0
----------

Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,5 @@ generate:
@go generate
@go mod tidy
@go mod vendor
@rm source.yaml
@cd ..
@ls -l *.go 1>&2
Loading

0 comments on commit 0aca010

Please sign in to comment.