51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
# 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>
|