Skip to content

ci: PLT-442: Remove missing fern-check needs #30

ci: PLT-442: Remove missing fern-check needs

ci: PLT-442: Remove missing fern-check needs #30

Workflow file for this run

name: ci
on:
push:
branches:
- master
workflow_dispatch:
jobs:
fern-generate-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
- name: Download Fern
run: npm install -g fern-api
- name: Check Fern API is valid
run: fern check
- name: Get version from label-studio-sdk
id: sdk-version
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GIT_PAT }}
script: |
const { repo, owner } = context.repo;
const sdk_repo = 'label-studio-sdk';
const pyProjectPath = 'pyproject.toml';
const {data: sdk_repo_data} = await github.rest.repos.get({
owner,
repo: sdk_repo,
});
const {data: commit} = await github.rest.repos.getCommit({
owner,
repo: sdk_repo,
ref: sdk_repo_data.default_branch,
});
const pyprojectBlob = await github.rest.repos.getContent({
owner,
repo: sdk_repo,
ref: commit.sha,
path: pyProjectPath,
});
const pyproject = Buffer.from(pyprojectBlob.data.content, pyprojectBlob.data.encoding).toString("utf8");
const versionMatch = pyproject.match(/version = "(?<version>[.a-f0-9]+)"/);
if (versionMatch && versionMatch.groups.version && false) {
core.setOutput('version', versionMatch.groups.version);
} else {
throw `Version not found in ${pyprojectBlob.url}`
}
- name: Publish Python SDK PR
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: fern generate --group python-sdk-staging --version ${{ steps.sdk-version.outputs.version }} --log-level debug