Skip to content

Commit dd91a3b

Browse files
authored
Merge pull request #245 from flovntp/patch-5
Update upsun.json
2 parents f680d23 + d47bee2 commit dd91a3b

File tree

3 files changed

+89
-13
lines changed

3 files changed

+89
-13
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: CI
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
48

59
permissions:
610
contents: read
@@ -54,7 +58,7 @@ jobs:
5458

5559
- name: Upload assets
5660
if: github.ref == 'refs/heads/main'
57-
uses: actions/upload-artifact@v3
61+
uses: actions/upload-artifact@v4
5862
with:
5963
name: platformify
6064
path: ./dist/*
@@ -86,7 +90,7 @@ jobs:
8690

8791
- name: Upload assets
8892
if: github.ref == 'refs/heads/main'
89-
uses: actions/upload-artifact@v3
93+
uses: actions/upload-artifact@v4
9094
with:
9195
name: upsunify
9296
path: ./dist/*

validator/schema/upsun.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@
116116
"title": "Whether the preflight security blocks are enabled",
117117
"description": "Must be a boolean",
118118
"enum": [
119-
"true",
120-
"false"
119+
true,
120+
false
121121
]
122122
},
123123
"ignored_rules": {
@@ -277,8 +277,8 @@
277277
"title": "Whether to allow serving files which don’t match a rule",
278278
"default": true,
279279
"enum": [
280-
"true",
281-
"false"
280+
true,
281+
false
282282
]
283283
},
284284
"headers": {
@@ -973,8 +973,8 @@
973973
"description": "If set to true, HSTS is enabled for 1 year. \nIf set to false, other properties are ignored.",
974974
"default": null,
975975
"enum": [
976-
"true",
977-
"false"
976+
true,
977+
false
978978
]
979979
},
980980
"include_subdomains": {
@@ -983,8 +983,8 @@
983983
"description": "More information: \nhttps://docs.upsun.com/define-routes/https.html#enable-http-strict-transport-security-hsts",
984984
"default": false,
985985
"enum": [
986-
"true",
987-
"false"
986+
true,
987+
false
988988
]
989989
},
990990
"preload": {
@@ -993,8 +993,8 @@
993993
"description": "To add your website to the HSTS preload list: \nhttps://hstspreload.org/. \nThanks to this list, most browsers are informed that your site requires HSTS before an HSTS header response is even issued.\n",
994994
"default": false,
995995
"enum": [
996-
"true",
997-
"false"
996+
true,
997+
false
998998
]
999999
}
10001000
},

validator/validator_test.go

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,78 @@ services:
190190
redis:
191191
type: redis:6.2
192192
size: AUTO
193+
`,
194+
),
195+
},
196+
},
197+
},
198+
wantErr: true,
199+
},
200+
{
201+
name: "true-boolean",
202+
args: args{
203+
path: fstest.MapFS{
204+
".upsun/config.yaml": &fstest.MapFile{
205+
Data: []byte(`
206+
applications:
207+
app1:
208+
type: "python:3.11"
209+
preflight:
210+
enabled: true
211+
`,
212+
),
213+
},
214+
},
215+
},
216+
wantErr: false,
217+
},
218+
{
219+
name: "false-boolean",
220+
args: args{
221+
path: fstest.MapFS{
222+
".upsun/config.yaml": &fstest.MapFile{
223+
Data: []byte(`
224+
applications:
225+
app1:
226+
type: "python:3.11"
227+
preflight:
228+
enabled: false
229+
`,
230+
),
231+
},
232+
},
233+
},
234+
wantErr: false,
235+
},
236+
{
237+
name: "true-string-boolean",
238+
args: args{
239+
path: fstest.MapFS{
240+
".upsun/config.yaml": &fstest.MapFile{
241+
Data: []byte(`
242+
applications:
243+
app1:
244+
type: "python:3.11"
245+
preflight:
246+
enabled: "true"
247+
`,
248+
),
249+
},
250+
},
251+
},
252+
wantErr: true,
253+
},
254+
{
255+
name: "false-string-boolean",
256+
args: args{
257+
path: fstest.MapFS{
258+
".upsun/config.yaml": &fstest.MapFile{
259+
Data: []byte(`
260+
applications:
261+
app1:
262+
type: "python:3.11"
263+
preflight:
264+
enabled: "false"
193265
`,
194266
),
195267
},

0 commit comments

Comments
 (0)