-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmerge_request_gitlab_generated.yml
More file actions
55 lines (43 loc) · 1.74 KB
/
merge_request_gitlab_generated.yml
File metadata and controls
55 lines (43 loc) · 1.74 KB
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
50
51
52
53
54
55
include:
- remote: "https://raw.githubusercontent.com/stainless-api/upload-openapi-spec-action/v1/build/gitlab-ci.yml"
- remote: "https://raw.githubusercontent.com/stainless-api/upload-openapi-spec-action/v1/checkout-pr-ref/gitlab-ci.yml"
.common:
variables:
# Stainless organization name.
ORG: YOUR_ORG
# Stainless project name.
PROJECT: YOUR_PROJECT
# Path to your OpenAPI spec.
OAS_PATH: YOUR_OAS_PATH
# Path to your Stainless config. Optional; only provide this if you prefer
# to maintain the ground truth Stainless config in your own repo.
CONFIG_PATH: YOUR_CONFIG_PATH
# When to fail the job based on build conclusion.
# Options: "never" | "note" | "warning" | "error" | "fatal".
FAIL_ON: error
# A Stainless API key, which you can generate on the Stainless organization dashboard
STAINLESS_API_KEY: $STAINLESS_API_KEY
# A GitLab token with permissions to read and write merge request comments.
GITLAB_TOKEN: $GITLAB_TOKEN
build-sdk:
extends: [.common, .build-sdk]
script:
- apk add --no-cache git
- |
if [ "$CI_PIPELINE_SOURCE" = "merge_request_event" ]; then
wget https://raw.githubusercontent.com/stainless-api/upload-openapi-spec-action/v1/dist/checkoutPRRef.js
REF="base" node checkoutPRRef.js
# generate oas and save to OAS_PATH
# { insert your code here }
REF="head" node checkoutPRRef.js
# generate oas and save to OAS_PATH
# { insert your code here }
else
# generate oas and save to OAS_PATH
# { insert your code here }
fi
- wget https://raw.githubusercontent.com/stainless-api/upload-openapi-spec-action/v1/dist/build.js
- node build.js
only:
- merge_requests
- main