Skip to content

Commit 1ef97bc

Browse files
authored
Relax app.yml detection to just "runtime" (#313)
Apparently "service" is optional if you're using the default service in the standard environment. Fixes GH-311
1 parent 5dbff71 commit 1ef97bc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ export async function findAppYaml(list: string[]): Promise<string> {
292292
const parsed = YAML.parse(contents);
293293

294294
// Per https://cloud.google.com/appengine/docs/standard/reference/app-yaml,
295-
// the only required fields are "runtime" and "service".
296-
if (parsed && parsed['runtime'] && parsed['service']) {
295+
// the only required field is "runtime".
296+
if (parsed && parsed['runtime']) {
297297
return pth;
298298
}
299299
} catch (err) {

tests/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ this is another file
255255
files: {
256256
'app-dev.yaml': `
257257
runtime: 'node'
258-
service: 'my-service'
259258
`,
260259
},
261260
expected: 'app-dev.yaml',
@@ -271,7 +270,6 @@ this is another file
271270
`,
272271
'app-prod.yaml': `
273272
runtime: 'node'
274-
service: 'my-service'
275273
`,
276274
},
277275
expected: 'app-prod.yaml',
@@ -286,10 +284,12 @@ service: 'my-service'
286284
'app-dev.yaml': `
287285
runtime: 'node'
288286
service: 'my-service'
287+
env: 'flex'
289288
`,
290289
'app-prod.yaml': `
291290
runtime: 'node'
292291
service: 'my-service'
292+
env: 'standard'
293293
`,
294294
},
295295
expected: 'app.yaml',

0 commit comments

Comments
 (0)