diff --git a/action.yml b/action.yml index 302ab867..1c4d7293 100644 --- a/action.yml +++ b/action.yml @@ -294,7 +294,15 @@ inputs: region: description: |- - Region in which the Cloud Run services are deployed. + Region in which the Cloud Run services are deployed. Providing a list enables + multi-region deployment. See the [documentation for deploying a multi-region + service](https://docs.cloud.google.com/run/docs/multiple-regions#deploy) + + Please note, this GitHub Action cannot parse regions provided in the metadata + YAML file and will always fallback to the region provided here, defaulting always + to `us-central1` if none is given. This is a known issue but this behavior being + kept to avoid breaking existing actions. + default: 'us-central1' required: false diff --git a/package-lock.json b/package-lock.json index 9c288f01..c4f5eec2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -474,6 +474,7 @@ "integrity": "sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.10.0" } @@ -524,6 +525,7 @@ "integrity": "sha512-r1XG74QgShUgXph1BYseJ+KZd17bKQib/yF3SR+demvytiRXrwd12Blnz5eYGm8tXaeRdd4x88MlfwldHoudGg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.42.0", "@typescript-eslint/types": "8.42.0", @@ -778,6 +780,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1163,6 +1166,7 @@ "integrity": "sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -1224,6 +1228,7 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -2234,6 +2239,7 @@ "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -2618,6 +2624,7 @@ "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/src/main.ts b/src/main.ts index e53f4382..c422d9bc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -248,12 +248,14 @@ export async function run(): Promise { .flat() .filter((e) => e !== undefined && e !== null && e !== '') .join(','); - deployCmd.push('--region', regions); - updateTrafficCmd.push('--region', regions); - } - if (projectId) { - deployCmd.push('--project', projectId); - updateTrafficCmd.push('--project', projectId); + + if (region?.length > 1) { + deployCmd.push('--regions', regions); + updateTrafficCmd.push('--regions', regions); + } else { + deployCmd.push('--region', regions); + updateTrafficCmd.push('--region', regions); + } } // Add optional deploy flags