Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ on:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- main
- next
merge_group:
types: [checks_requested]
workflow_dispatch:

permissions:
Expand All @@ -15,13 +19,15 @@ permissions:

jobs:
analyze:
name: Analyze Python
name: ${{ ((github.event_name == 'pull_request' && github.base_ref == 'next') || (github.event_name == 'merge_group' && github.event.merge_group.base_ref == 'refs/heads/next')) && 'Analyze Python (next)' || 'Analyze Python' }}
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@7188fc363630916deb702c7fdcf4e481b751f97a # v4
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/detect-breaking-changes.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: CI
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- main
- next
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
release_pr:
Expand All @@ -22,10 +25,10 @@ permissions:
jobs:
detect_breaking_changes:
runs-on: 'ubuntu-latest'
name: detect-breaking-changes
if: github.repository == 'openai/openai-python' && (github.event_name == 'pull_request' || (inputs.release_pr && github.ref == 'refs/heads/release-please--branches--main'))
name: ${{ ((github.event_name == 'pull_request' && github.base_ref == 'next') || (github.event_name == 'merge_group' && github.event.merge_group.base_ref == 'refs/heads/next')) && 'detect-breaking-changes (next)' || 'detect-breaking-changes' }}
if: github.repository == 'openai/openai-python' && (github.event_name == 'pull_request' || github.event_name == 'merge_group' || (inputs.release_pr && github.ref == 'refs/heads/release-please--branches--main'))
env:
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || inputs.base_sha }}
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || (github.event_name == 'merge_group' && github.event.merge_group.base_sha) || inputs.base_sha }}
FETCH_DEPTH: 0
steps:
- name: Calculate fetch-depth
Expand All @@ -41,6 +44,13 @@ jobs:
fetch-depth: ${{ env.FETCH_DEPTH }}
persist-credentials: false

- name: Validate comparison baseline
shell: bash
run: |
[[ "$BASE_SHA" =~ ^[0-9a-f]{40}$ ]] || { echo "Invalid comparison base SHA"; exit 1; }
git cat-file -e "$BASE_SHA^{commit}"
git merge-base --is-ancestor "$BASE_SHA" HEAD

- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
Expand Down
Loading