Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
paths:
'**/*.yml':
ignore:
# https://github.com/rhysd/actionlint/issues/559
- 'invalid runner name "node24"'
2 changes: 1 addition & 1 deletion .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4

- uses: 'google-github-actions/auth@v2' # ratchet:exclude
- uses: 'google-github-actions/auth@v3' # ratchet:exclude
with:
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'
service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: 'npm build'
run: 'npm ci && npm run build'

- uses: 'google-github-actions/auth@v2' # ratchet:exclude
- uses: 'google-github-actions/auth@v3' # ratchet:exclude
with:
project_id: '${{ vars.PROJECT_ID }}'
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: 'npm build'
run: 'npm ci && npm run build'

- uses: 'google-github-actions/auth@v2' # ratchet:exclude
- uses: 'google-github-actions/auth@v3' # ratchet:exclude
with:
project_id: '${{ vars.PROJECT_ID }}'
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
run: 'npm ci && npm run build'

- id: 'auth'
uses: 'google-github-actions/auth@v2' # ratchet:exclude
uses: 'google-github-actions/auth@v3' # ratchet:exclude
if: |-
${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
with:
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
This action deploys your function source code to [Cloud Functions][cloud-functions] and makes the URL
available to later build steps via outputs.

> [!CAUTION]
>
> **This README corresponds to the "v3" GitHub Action**, which is currently in
> beta. If you are using "v2", see the [documentation for
> google-github-actions/deploy-cloud-functions@v2](https://github.com/google-github-actions/deploy-cloud-functions/tree/release/v2).

**This is not an officially supported Google product, and it is not covered by a
Google Cloud support contract. To report bugs or request features in a Google
Cloud product, please contact [Google Cloud
Expand All @@ -21,9 +15,10 @@ support](https://cloud.google.com/support).**
the secrets being requested. See [Authorization](#authorization) for more
information.

- This action runs using Node 20. If you are using self-hosted GitHub Actions
runners, you must use a version of the GitHub Actions runner that supports
Node 20 or higher.
- This action runs using Node 24. If you are using self-hosted GitHub Actions
runners, you must use a [runner
version](https://github.com/actions/virtual-environments) that supports this
version or later.


## Usage
Expand All @@ -40,13 +35,13 @@ jobs:
- uses: 'actions/checkout@v4'

- id: 'auth'
uses: 'google-github-actions/auth@v2'
uses: 'google-github-actions/auth@v3'
with:
project_id: 'my-project'
workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'

- id: 'deploy'
uses: 'google-github-actions/deploy-cloud-functions@v3'
uses: 'google-github-actions/deploy-cloud-functions@v4'
timeout-minutes: 10
with:
name: 'my-function'
Expand Down Expand Up @@ -130,7 +125,9 @@ jobs:
- <a name="__input_runtime"></a><a href="#user-content-__input_runtime"><code>runtime</code></a>: _(Required)_ Runtime for the function, such as "nodejs20". For a list of all available
runtimes, run:

$ gcloud functions runtimes list
```sh
$ gcloud functions runtimes list
```

The available runtimes change over time.

Expand Down Expand Up @@ -160,10 +157,10 @@ jobs:
- <a name="__input_build_worker_pool"></a><a href="#user-content-__input_build_worker_pool"><code>build_worker_pool</code></a>: _(Optional)_ Name of the Cloud Build Custom Worker Pool that should be used to build
the function. The format of this field is:

projects/<project>/locations/<region>/workerPools/<workerPool>
projects/[PROJECT]/locations/[REGION]/workerPools/[WORKER_POOL]

where `<project>` and `<region>` are the project id and region
respectively where the worker pool is defined and `<workerPool>` is the
where `[PROJECT]` and `[REGION]` are the project id and region
respectively where the worker pool is defined and `[WORKER_POOL]` is the
short name of the worker pool.

If the project ID is not the same as the function, then the Cloud
Expand All @@ -177,7 +174,7 @@ jobs:

The value must match the pattern:

projects/<project>/locations/<location>/repositories/<repository>.
projects/[PROJECT]/locations/[LOCATION]/repositories/[REPOSITORY].

Cross-project repositories are not supported. Cross-location repositories
are not supported. Repository format must be 'DOCKER'.
Expand Down Expand Up @@ -240,7 +237,6 @@ jobs:
volumes. Keys starting with a forward slash '/' are mount paths. All other
keys correspond to environment variables:


```yaml
with:
secrets: |-
Expand Down Expand Up @@ -283,11 +279,15 @@ jobs:
- <a name="__input_event_trigger_type"></a><a href="#user-content-__input_event_trigger_type"><code>event_trigger_type</code></a>: _(Optional)_ Specifies which action should trigger the function. For a list of
acceptable values, run:

$ gcloud functions event-types list
```sh
$ gcloud functions event-types list
```

This usually requires the eventarc API to be enabled:

$ gcloud services enable eventarc.googleapis.com
```sh
$ gcloud services enable eventarc.googleapis.com
```

The available trigger types may change over time.

Expand Down Expand Up @@ -319,7 +319,7 @@ jobs:
will trigger function execution with message contents passed as input
data of the format:

projects/<project_id>/topics/<topic_id>
projects/[PROJECT]/topics/[TOPIC]

The service account must have permissions on this topic.

Expand All @@ -331,7 +331,7 @@ jobs:

- <a name="__input_event_trigger_channel"></a><a href="#user-content-__input_event_trigger_channel"><code>event_trigger_channel</code></a>: _(Optional)_ The name of the channel associated with the trigger in the format:

projects/<project>/locations/<location>/channels/<channel>
projects/[PROJECT]/locations/[LOCATION]/channels/<channel>

You must provide a channel to receive events from Eventarc SaaS partners.

Expand All @@ -355,7 +355,7 @@ service](https://cloud.google.com/functions/docs/securing/managing-access-iam).

- <a name="__output_name"></a><a href="#user-content-__output_name"><code>name</code></a>: Full resource name of the Cloud Function, of the format:

projects/<project>/locations/<location>/functions/<function>
projects/[PROJECT]/locations/[LOCATION]/functions/<function>

- <a name="__output_url"></a><a href="#user-content-__output_url"><code>url</code></a>: The URL of your Cloud Function.

Expand Down Expand Up @@ -397,13 +397,13 @@ jobs:
- uses: 'actions/checkout@v4'

- id: 'auth'
uses: 'google-github-actions/auth@v2'
uses: 'google-github-actions/auth@v3'
with:
project_id: 'my-project'
workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'

- id: 'deploy'
uses: 'google-github-actions/deploy-cloud-functions@v3'
uses: 'google-github-actions/deploy-cloud-functions@v4'
timeout-minutes: 10
with:
name: 'my-function'
Expand All @@ -424,7 +424,7 @@ jobs:
- uses: 'actions/checkout@v4'

- id: 'deploy'
uses: 'google-github-actions/deploy-cloud-functions@v3'
uses: 'google-github-actions/deploy-cloud-functions@v4'
timeout-minutes: 10
with:
name: 'my-function'
Expand Down
31 changes: 18 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ inputs:
Runtime for the function, such as "nodejs20". For a list of all available
runtimes, run:

$ gcloud functions runtimes list
```sh
$ gcloud functions runtimes list
```

The available runtimes change over time.
required: true
Expand Down Expand Up @@ -163,10 +165,10 @@ inputs:
Name of the Cloud Build Custom Worker Pool that should be used to build
the function. The format of this field is:

projects/<project>/locations/<region>/workerPools/<workerPool>
projects/[PROJECT]/locations/[REGION]/workerPools/[WORKER_POOL]

where `<project>` and `<region>` are the project id and region
respectively where the worker pool is defined and `<workerPool>` is the
where `[PROJECT]` and `[REGION]` are the project id and region
respectively where the worker pool is defined and `[WORKER_POOL]` is the
short name of the worker pool.

If the project ID is not the same as the function, then the Cloud
Expand All @@ -183,7 +185,7 @@ inputs:

The value must match the pattern:

projects/<project>/locations/<location>/repositories/<repository>.
projects/[PROJECT]/locations/[LOCATION]/repositories/[REPOSITORY].

Cross-project repositories are not supported. Cross-location repositories
are not supported. Repository format must be 'DOCKER'.
Expand Down Expand Up @@ -281,7 +283,6 @@ inputs:
volumes. Keys starting with a forward slash '/' are mount paths. All other
keys correspond to environment variables:


```yaml
with:
secrets: |-
Expand Down Expand Up @@ -347,11 +348,15 @@ inputs:
Specifies which action should trigger the function. For a list of
acceptable values, run:

$ gcloud functions event-types list
```sh
$ gcloud functions event-types list
```

This usually requires the eventarc API to be enabled:

$ gcloud services enable eventarc.googleapis.com
```sh
$ gcloud services enable eventarc.googleapis.com
```

The available trigger types may change over time.
required: false
Expand Down Expand Up @@ -388,7 +393,7 @@ inputs:
will trigger function execution with message contents passed as input
data of the format:

projects/<project_id>/topics/<topic_id>
projects/[PROJECT]/topics/[TOPIC]

The service account must have permissions on this topic.
required: false
Expand All @@ -410,7 +415,7 @@ inputs:
description: |-
The name of the channel associated with the trigger in the format:

projects/<project>/locations/<location>/channels/<channel>
projects/[PROJECT]/locations/[LOCATION]/channels/<channel>

You must provide a channel to receive events from Eventarc SaaS partners.
required: false
Expand All @@ -421,7 +426,7 @@ outputs:
description: |-
Full resource name of the Cloud Function, of the format:

projects/<project>/locations/<location>/functions/<function>
projects/[PROJECT]/locations/[LOCATION]/functions/<function>

url:
description: |-
Expand All @@ -433,5 +438,5 @@ branding:
color: 'blue'

runs:
using: 'node20'
main: 'dist/index.js'
using: 'node24'
main: 'dist/main/index.js'
21 changes: 0 additions & 21 deletions bin/runTests.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions dist/index.js → dist/main/index.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"description": "Deploy a Cloud Function",
"main": "dist/index.js",
"scripts": {
"build": "ncc build -m src/main.ts",
"build": "rm -rf dist/ && ncc build -m src/main.ts -o dist/main",
"docs": "./node_modules/.bin/actions-gen-readme",
"lint": "eslint .",
"format": "eslint . --fix",
"test": "bash ./bin/runTests.sh"
"test": "node --require ts-node/register --test-reporter spec --test tests/**/*.test.ts"
},
"engines": {
"node": ">= 20.x",
"node": ">= 24.x",
"npm": ">= 11.x"
},
"repository": {
Expand All @@ -30,7 +30,7 @@
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/http-client": "^2.2.3",
"@google-github-actions/actions-utils": "^0.8.10",
"@google-github-actions/actions-utils": "^1.0.1",
"archiver": "^7.0.1",
"google-auth-library": "^10.3.0",
"ignore": "^7.0.5"
Expand Down
Loading