Skip to content

Commit 627c9d3

Browse files
authored
fix: accept region
1 parent c9f24af commit 627c9d3

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.github/workflows/deploy-cf-it.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
uses: ./
9191
with:
9292
name: cf-http-json-${{ github.run_number }}
93+
region: us-east1
9394
runtime: nodejs10
9495
entry_point: helloWorld
9596
source_dir: ./tests/test-node-func/
@@ -111,5 +112,6 @@ jobs:
111112
run: npm run cleanup
112113
env:
113114
DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
114-
CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-central1/functions/cf-http-json-${{ github.run_number }}
115+
CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-east1/functions/cf-http-json-${{ github.run_number }}
116+
CF_REGION: us-east1
115117

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ steps:
5151

5252
- `entry_point`: (Optional) Name of a function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified.
5353

54-
- `region`: (Optional) Region in which the function should be deployed. Defaults to `us-central1`.
54+
- `region`: (Optional) [Region](https://cloud.google.com/functions/docs/locations) in which the function should be deployed. Defaults to `us-central1`.
5555

5656
- `credentials`: (Optional) Service account key to use for authentication. This should be
5757
the JSON formatted private key which can be exported from the Cloud Console. The

action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ inputs:
4242
Project to deploy the function in.
4343
required: false
4444

45+
region:
46+
description: |-
47+
Region to deploy the function in. Defaults to us-central1, if not specified.
48+
required: false
49+
4550
source_dir:
4651
description: |-
4752
Path to function deployment directory within the source repo.

tests/cleaner/cleanTestFunctions.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ describe('CloudFunction', function () {
3535
'Cloud Function name, project id and credentials are required.',
3636
);
3737
}
38-
const client = new CloudFunctionClient('us-central1', {
38+
const region = process.env.CF_REGION || 'us-central1';
39+
const client = new CloudFunctionClient(region, {
3940
projectId,
4041
credentials,
4142
});

0 commit comments

Comments
 (0)