-
-
Notifications
You must be signed in to change notification settings - Fork 124
49 lines (40 loc) · 1.33 KB
/
code_samples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Update SDK code samples
on:
workflow_dispatch:
inputs:
schema_url:
description: 'URL of the base OpenAPI schema'
required: true
default: 'https://api.polar.sh/openapi.json'
languages:
description: 'Comma-separated list of languages to generate code samples for'
required: true
default: 'python,js'
concurrency:
group: update-sdk-code-samples
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}/sdk
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Speakeasy CLI
run: |
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
- name: Download and apply code samples overlay to OpenAPI schema
run: ./code_samples.sh ${{ github.event.inputs.schema_url }} ${{ github.event.inputs.languages }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
add-paths: sdk/schema.json
commit-message: 'docs: update SDK code samples'
title: 'docs: update SDK code samples'
branch: update-sdk-code-samples
delete-branch: true