Skip to content

SDK Update API from Spec #556

SDK Update API from Spec

SDK Update API from Spec #556

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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 16
check-latest: true
cache: npm
- name: Download stable OpenAPI schema
run: |
curl -sL https://repo.jellyfin.org/releases/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 }}