Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
gittb committed Oct 19, 2024
1 parent a7834eb commit dc329f5
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/extract-openai-types.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,35 @@
name: Extract OpenAI Types

on:
push:
branches:
- main
workflow_dispatch: # Allow manual triggering
- master
workflow_dispatch:

jobs:
extract-types:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout current repository
uses: actions/checkout@v4

# Step 2: Fetch the latest OpenAI release
- name: Download latest OpenAI release zip
run: |
# Get the latest release version number
latest_release=$(curl -s https://api.github.com/repos/openai/openai-python/releases/latest | jq -r '.tag_name')
# Download the latest release zip
curl -L https://github.com/openai/openai-python/archive/refs/tags/${latest_release}.zip -o openai-latest.zip
curl -L "https://github.com/openai/openai-python/archive/refs/tags/${latest_release}.zip" -o openai-latest.zip
# Step 3: Extract the `types` folder from the release
- name: Extract `types` folder
run: |
# Unzip the archive
unzip openai-latest.zip -d openai-package
# Copy only the /src/openai/types folder
mkdir -p lmos-openai-types
cp -r lmos-openai-types/openai-python-${latest_release}/src/openai/types openai-types/
cp -r openai-package/openai-python-*/src/openai/types lmos-openai-types/
# Step 4: Commit the extracted types to a new branch
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure git
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# Create a new branch
git checkout -b openai-types-extracted
# Add the new files
git add lmos-openai-types
# Commit the changes
git commit -m "Extracted types from OpenAI ${latest_release}"
# Push the new branch
git push origin openai-types-extracted
git push origin openai-types-extracted

0 comments on commit dc329f5

Please sign in to comment.