Skip to content

Commit 9e18a31

Browse files
committed
Updated stainless config file to use api key auth
1 parent 7533d03 commit 9e18a31

File tree

1 file changed

+6
-45
lines changed

1 file changed

+6
-45
lines changed

.github/workflows/stainless.yml

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Stainless SDK Builds
1+
name: Build SDKs for pull request
22

33
on:
44
pull_request:
@@ -7,91 +7,52 @@ on:
77
- synchronize
88
- reopened
99
- closed
10-
paths:
11-
- "packages/server/openapi.v3.yaml"
12-
- ".github/workflows/stainless.yml"
1310

1411
concurrency:
15-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
1613
cancel-in-progress: true
1714

1815
env:
19-
# Configure these as GitHub Actions Variables (Settings → Secrets and variables → Actions → Variables)
2016
STAINLESS_ORG: ${{ vars.STAINLESS_ORG }}
2117
STAINLESS_PROJECT: ${{ vars.STAINLESS_PROJECT }}
2218
OAS_PATH: packages/server/openapi.v3.yaml
2319

2420
jobs:
2521
preview:
26-
if: github.event_name != 'pull_request' || github.event.action != 'closed'
22+
if: github.event.action != 'closed'
2723
runs-on: ubuntu-latest
2824
permissions:
2925
contents: read
3026
pull-requests: write
31-
id-token: write
3227
steps:
3328
- name: Checkout repository
3429
uses: actions/checkout@v4
3530
with:
3631
fetch-depth: 2
3732

38-
- name: Validate Stainless configuration
39-
shell: bash
40-
run: |
41-
set -euo pipefail
42-
if [[ -z "${STAINLESS_ORG}" ]]; then
43-
echo "Missing STAINLESS_ORG. Set the Actions variable STAINLESS_ORG."
44-
exit 1
45-
fi
46-
if [[ -z "${STAINLESS_PROJECT}" ]]; then
47-
echo "Missing STAINLESS_PROJECT. Set the Actions variable STAINLESS_PROJECT."
48-
exit 1
49-
fi
50-
if [[ ! -f "${OAS_PATH}" ]]; then
51-
echo "OpenAPI spec not found at ${OAS_PATH}"
52-
exit 1
53-
fi
54-
5533
- name: Run preview builds
5634
uses: stainless-api/upload-openapi-spec-action/preview@v1
5735
with:
36+
stainless_api_key: ${{ secrets.STAINLESS_API_KEY }}
5837
org: ${{ env.STAINLESS_ORG }}
5938
project: ${{ env.STAINLESS_PROJECT }}
6039
oas_path: ${{ env.OAS_PATH }}
6140

6241
merge:
63-
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
42+
if: github.event.action == 'closed' && github.event.pull_request.merged == true
6443
runs-on: ubuntu-latest
6544
permissions:
6645
contents: read
6746
pull-requests: write
68-
id-token: write
6947
steps:
7048
- name: Checkout repository
7149
uses: actions/checkout@v4
7250
with:
7351
fetch-depth: 2
74-
75-
- name: Validate Stainless configuration
76-
shell: bash
77-
run: |
78-
set -euo pipefail
79-
if [[ -z "${STAINLESS_ORG}" ]]; then
80-
echo "Missing STAINLESS_ORG. Set the Actions variable STAINLESS_ORG."
81-
exit 1
82-
fi
83-
if [[ -z "${STAINLESS_PROJECT}" ]]; then
84-
echo "Missing STAINLESS_PROJECT. Set the Actions variable STAINLESS_PROJECT."
85-
exit 1
86-
fi
87-
if [[ ! -f "${OAS_PATH}" ]]; then
88-
echo "OpenAPI spec not found at ${OAS_PATH}"
89-
exit 1
90-
fi
91-
9252
- name: Run merge build
9353
uses: stainless-api/upload-openapi-spec-action/merge@v1
9454
with:
55+
stainless_api_key: ${{ secrets.STAINLESS_API_KEY }}
9556
org: ${{ env.STAINLESS_ORG }}
9657
project: ${{ env.STAINLESS_PROJECT }}
9758
oas_path: ${{ env.OAS_PATH }}

0 commit comments

Comments
 (0)