Skip to content

Commit 9717ada

Browse files
authored
bug: fix missing field masks on update (#326)
Fixes GH-316 Fixes GH-318
1 parent 63c570d commit 9717ada

File tree

7 files changed

+380
-169
lines changed

7 files changed

+380
-169
lines changed

.github/workflows/unit.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ jobs:
3838
- name: 'npm lint'
3939
# There's no need to run the linter for each operating system, since it
4040
# will find the same thing 3x and clog up the PR review.
41-
if: ${{matrix.os == 'ubuntu-latest'}}
41+
if: ${{ matrix.os == 'ubuntu-latest' }}
4242
run: 'npm run lint'
4343

4444
- name: 'npm test'
4545
env:
4646
DEPLOY_CF_PROJECT_ID: '${{ secrets.DEPLOY_CF_PROJECT_ID }}'
47+
DEPLOY_CF_SA_EMAIL: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'
4748
DEPLOY_CF_SA_KEY_JSON: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
49+
DEPLOY_CF_SECRET_VERSION_REF: '${{ secrets.DEPLOY_CF_SECRET_VERSION_REF }}'
4850
run: 'npm run test'

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ jobs:
129129
All existing secret volume mounts will be removed, even if this parameter is
130130
not passed.
131131

132-
- `service_account_email`: (Optional) The email address of the IAM service account associated with the function at runtime.
132+
- `service_account_email`: (Optional) The email address of the Google Cloud
133+
service account to use as the runtime service account for the function. If
134+
unspecified, the default Cloud Functions runtime service account is used.
135+
136+
Note this differs from the service account used to deploy the Cloud
137+
Function, which is the currently-authenticated principal. See
138+
[Authorization](#Authorization) for more information.
133139

134140
- `timeout`: (Optional) The function execution timeout in seconds. Defaults to 60.
135141

@@ -211,17 +217,23 @@ automatically private services, while deploying a revision of a public
211217

212218
## Authorization
213219

214-
There are a few ways to authenticate this action. A service account will be needed
215-
with the following roles:
220+
The _deployment_ service account must have the following IAM permissions:
221+
222+
- Cloud Functions Admin (`roles/cloudfunctions.admin`)
223+
224+
Additionally, the _deployment_ service account must have permissions to act as
225+
(impersonate) the _runtime_ service account, which can be achieved by granting
226+
the deployment _service_ account "roles/iam.serviceAccountUser" permissions on
227+
the _runtime_ service account. If unspecified, the _runtime_ service account is the App Engine Default Service Account `[email protected]`.
216228

217-
- Cloud Functions Admin (`cloudfunctions.admin`):
218-
- Can create, update, and delete functions.
219-
- Can set IAM policies and view source code.
229+
In some cases, the Cloud Build service account, which defaults as
230+
`[email protected]`, may also need to be granted
231+
"roles/iam.serviceAccountUser" permission on the _runtime_ service account.
220232

221-
This service account needs to be a member of the `App Engine default service account`
222-
`([email protected].com)`, with role
223-
`Service Account User` (`roles/iam.serviceAccountUser`). See [additional configuration for deployment](https://cloud.google.com/functions/docs/reference/iam/roles#additional-configuration)
224-
for further instructions.
233+
See the Google Cloud documentation to [learn more about custom runtime service
234+
accounts](https://cloud.google.com/functions/docs/securing/function-identity#individual)
235+
and [additional configuration for
236+
deployment](https://cloud.google.com/functions/docs/reference/iam/roles#additional-configuration)
225237

226238
### Via google-github-actions/auth
227239

action.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,16 @@ inputs:
121121

122122
service_account_email:
123123
description: |-
124-
The email address of the IAM service account associated with the function at runtime.
124+
The email address of the Google Cloud service account to use as the
125+
runtime service account for the function. If unspecified, the default
126+
Cloud Functions runtime service account is used.
127+
128+
Note this differs from the service account used to deploy the Cloud
129+
Function, which is the currently-authenticated principal. However, the
130+
deploying service account must have permission to impersonate the runtime
131+
service account, which can be achieved by granting the deployment service
132+
account "roles/iam.serviceAccountUser" permission on the runtime service
133+
account.
125134
required: false
126135

127136
timeout:

0 commit comments

Comments
 (0)