Skip to content

Test PR

Test PR #542

Workflow file for this run

name: generate
permissions:
contents: write
on:
pull_request:
paths:
- 'justfile'
- .github/workflows/generate.yml
- 'spec.json'
- 'generate/generate.py'
workflow_dispatch:
inputs:
jobs:
format:
# Check if the PR is not from a fork
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
# required
app-id: ${{ secrets.GH_ORG_APP_ID }}
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install just
uses: extractions/setup-just@v3
- name: Run generate
shell: bash
run: |
just generate
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
- name: Commit changes, if any
run: |
git config --local user.email "zoo-github-actions-auth[bot]@users.noreply.github.com"
git config --local user.name "zoo-github-actions-auth[bot]"
git remote set-url origin https://${{ github.actor }}:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
git fetch origin
git add .
git commit --allow-empty -am "I have generated the latest API!" || true
git push origin ${{github.event.pull_request.head.ref }} || true
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}