workflows: add api generation workflow

Add a workflow to re-generate api changes on a cronjob that runs every day.
This commit is contained in:
Gianluca Zuccarelli 2025-08-13 10:23:51 +01:00
parent 223d11b691
commit 0c47c4b165
2 changed files with 51 additions and 1 deletions

51
.github/workflows/update-apis.yml vendored Normal file
View file

@ -0,0 +1,51 @@
# This action checks API updates every day at 5:00 UTC.
name: Update API code generation
on:
workflow_dispatch:
schedule:
- cron: "0 5 * * *"
jobs:
update-api:
name: "Update API definitions"
if: github.repository == 'osbuild/image-builder-frontend'
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Mark the working directory as safe for git
run: git config --global --add safe.directory "$(pwd)"
- name: Run API code generation
run: npm run api
- name: Check if there are any changes
run: |
if [ "$(git status --porcelain)" ]; then
echo
echo "API codegen is up-to-date"
exit "0"
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: update-apis
delete-branch: true
title: "api: regenerate api code generation"
commit-message: "api: regenerate api code generation"
body: Update api code generation
token: ${{ secrets.SCHUTZBOT_GITHUB_ACCESS_TOKEN }}
author: schutzbot <schutzbot@gmail.com>

View file

@ -50,7 +50,6 @@ export type UploadTypes =
| "azure"
| "container"
| "oci.objectstorage"
| "pulp.ostree"
| "local";
export type Awsec2UploadStatus = {
ami: string;