Update api spec #640
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
jobs: | |
build: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/[email protected] | |
with: | |
node-version: '20.9.0' | |
cache: 'yarn' | |
- run: yarn install | |
- run: yarn gen | |
- run: yarn build | |
# Generate the OpenAPI spec. Yes, yarn test generates it. | |
- run: yarn test | |
env: | |
KITTYCAD_TOKEN: ${{ secrets.KITTYCAD_TOKEN }} | |
BASE_URL: "https://api.dev.kittycad.io/" | |
- name: check for changes | |
id: git-check | |
run: | | |
git add . | |
if git status | grep -q "Changes to be committed" | |
then echo "modified=true" >> $GITHUB_OUTPUT | |
else echo "modified=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit changes, if any | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git add . | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
git fetch origin | |
echo ${{ github.head_ref }} | |
git checkout ${{ github.head_ref }} | |
git commit -am "Generated new lib" || true | |
git push | |
git push origin ${{ github.head_ref }} | |
- name: Bump package.json version | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
npm version patch | |
git push origin ${{ github.head_ref }} |