Skip to content

SDK Update API from Spec #811

SDK Update API from Spec

SDK Update API from Spec #811

name: SDK Update API from Spec
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
api-spec-update:
runs-on: ubuntu-latest
if: ${{ github.repository == 'jellyfin/jellyfin-sdk-typescript' }}
steps:
- name: Check out Git repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
check-latest: true
cache: npm
- name: Download stable OpenAPI schema
run: |
curl -sL https://api.jellyfin.org/openapi/jellyfin-openapi-stable.json -o openapi.json
npm run fix-schema
cp openapi.json $HOME
- name: Set STABLE_API_VERSION
run: |
VERSION=$(jq -r .info.version openapi.json)
echo "STABLE_API_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Install Node.js dependencies
run: npm ci --no-audit
- name: Update generated sources and create pull request
uses: technote-space/create-pr-action@91114507cf92349bec0a9a501c2edf1635427bc5 # v2
with:
EXECUTE_COMMANDS: |
cp $HOME/openapi.json .
npm run build:generated-client
sed -i "s/API_VERSION = '.*'/API_VERSION = '${{ env.STABLE_API_VERSION }}'/" src/versions.ts
COMMIT_MESSAGE: 'Update generated sources to ${{ env.STABLE_API_VERSION }}'
COMMIT_NAME: 'jellyfin-bot'
COMMIT_EMAIL: '[email protected]'
PR_BRANCH_PREFIX: 'openapi-update-'
PR_BRANCH_NAME: '${PR_ID}'
PR_TITLE: 'Update OpenAPI to ${{ env.STABLE_API_VERSION }}'
PR_BODY: |
## Changed files
<details>
<summary>${FILES_SUMMARY}</summary>
${FILES}
</details>
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }}