Skip to content

Commit f4156b7

Browse files
authored
Fix docsgen and remove deprecated field (#394)
1 parent 7de7c8e commit f4156b7

File tree

5 files changed

+193
-78
lines changed

5 files changed

+193
-78
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
6464
- name: 'Verify deployment'
6565
run: |-
66-
curl '${{ steps.deploy.outputs.url }}' \
66+
curl '${{ steps.deploy.outputs.version_url }}' \
6767
--silent \
6868
--fail \
6969
--location \

README.md

Lines changed: 98 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -46,77 +46,121 @@ jobs:
4646
4747
## Inputs
4848
49-
- `project_id`: (Optional) ID of the Google Cloud project. If not provided,
50-
this is inherited from the environment.
49+
<!-- BEGIN_AUTOGEN_INPUTS -->
5150
52-
- `working_directory`: (Optional) The working directory to use. **Actions do
53-
not honor [default working-directory
51+
- <a name="__input_project_id"></a><a href="#user-content-__input_project_id"><code>project_id</code></a>: _(Optional)_ ID of the Google Cloud project. If not provided, this is inherited from
52+
the environment.
53+
54+
- <a name="__input_working_directory"></a><a href="#user-content-__input_working_directory"><code>working_directory</code></a>: _(Optional)_ The working directory to use. **GitHub Actions do not honor [default
55+
working-directory
5456
settings](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaultsrun).**
5557
The `deliverables` input is a relative path based on this setting.
5658

57-
- `deliverables`: (Optional) The [yaml
59+
- <a name="__input_deliverables"></a><a href="#user-content-__input_deliverables"><code>deliverables</code></a>: _(Optional)_ The [yaml
5860
files](https://cloud.google.com/appengine/docs/standard/nodejs/configuration-files#optional_configuration_files)
5961
for the services or configurations you want to deploy. If not given,
6062
defaults to app.yaml in the current directory. If that is not found,
6163
attempts to automatically generate necessary configuration files (such as
62-
app.yaml) in the current directory (example, `app.yaml cron.yaml`). Note:
63-
the additional deliverables may require additional roles for your service
64-
account user.
64+
app.yaml) in the current directory (example, `app.yaml cron.yaml`).
65+
66+
Note: The additional deliverables may require additional roles for your
67+
service account user.
6568

66-
- `build_env_vars`: (Optional) List of key=value pairs to set as environment
67-
variables during tbe build process. This will overwrite any duplicate key
68-
environment variables defined in the app.yaml.
69+
- <a name="__input_build_env_vars"></a><a href="#user-content-__input_build_env_vars"><code>build_env_vars</code></a>: _(Optional)_ List of build environment variables that should be set in the build
70+
environment. These are comma-separated or newline-separated `KEY=VALUE`.
71+
Keys or values that contain separators must be escaped with a backslash
72+
(e.g. `\,` or `\\n`) unless quoted. Any leading or trailing whitespace is
73+
trimmed unless values are quoted.
6974

7075
```yaml
71-
with:
72-
build_env_vars: |-
73-
FOO=bar
74-
ZIP=zap
76+
build_env_vars: |-
77+
FRUIT=apple
78+
SENTENCE=" this will retain leading and trailing spaces "
7579
```
7680

77-
Note: To include environment variables defined in another file, use the
78-
[`includes` directive][includes-directive] in your app.yaml.
81+
This value will only be set if the input is a non-empty value. If a
82+
non-empty value is given, the field values will be overwritten (not
83+
merged). To remove all values, set the value to the literal string `{}`.
7984

80-
- `env_vars`: (Optional) List of key=value pairs to set as environment
81-
variables. This will overwrite any duplicate key environment variables
82-
defined in the app.yaml.
85+
To include build environment variables defined in another file, use the
86+
[`includes` directive][includes-directive] in your `app.yaml`.
87+
88+
This will overwrite any duplicate key environment variables defined in the
89+
`app.yaml`.
90+
91+
- <a name="__input_env_vars"></a><a href="#user-content-__input_env_vars"><code>env_vars</code></a>: _(Optional)_ List of environment variables that should be set in the environment. These
92+
are comma-separated or newline-separated `KEY=VALUE`. Keys or values that
93+
contain separators must be escaped with a backslash (e.g. `\,` or `\\n`)
94+
unless quoted. Any leading or trailing whitespace is trimmed unless values
95+
are quoted.
8396

8497
```yaml
85-
with:
86-
env_vars: |-
87-
FOO=bar
88-
ZIP=zap
98+
env_vars: |-
99+
FRUIT=apple
100+
SENTENCE=" this will retain leading and trailing spaces "
89101
```
90102

91-
Note: To include environment variables defined in another file, use the
92-
[`includes` directive][includes-directive] in your app.yaml.
103+
This value will only be set if the input is a non-empty value. If a
104+
non-empty value is given, the field values will be overwritten (not
105+
merged). To remove all values, set the value to the literal string `{}`.
106+
107+
To include environment variables defined in another file, use the
108+
[`includes` directive][includes-directive] in your `app.yaml`.
109+
110+
This will overwrite any duplicate key environment variables defined in the
111+
`app.yaml`.
112+
113+
- <a name="__input_image_url"></a><a href="#user-content-__input_image_url"><code>image_url</code></a>: _(Optional)_ Fully-qualified name
114+
of the container image to deploy. For example:
115+
116+
us-docker.pkg.dev/cloudrun/container/hello:latest
117+
118+
or
93119

94-
- `image_url`: (Optional) Deploy with a specific container image. The image
95-
url must be from one of the valid GCR hostnames (example, `gcr.io/`).
120+
us-docker.pkg.dev/my-project/my-container/image:1.2.3
96121

97-
- `version`: (Optional) The version of the app that will be created or
98-
replaced by this deployment. If you do not specify a version, one will be
99-
generated for you.
122+
- <a name="__input_version"></a><a href="#user-content-__input_version"><code>version</code></a>: _(Optional)_ The version of the app that will be created or replaced by this
123+
deployment. If you do not specify a version, one will be generated for
124+
you.
100125

101-
- `promote`: (Optional) Promote the deployed version to receive all traffic.
102-
The default is `true`.
126+
- <a name="__input_promote"></a><a href="#user-content-__input_promote"><code>promote</code></a>: _(Optional, default: `true`)_ Promote the deployed version to receive all traffic.
103127

104-
- `flags`: (Optional) Space-separated list of other App Engine flags. This can
105-
be used to access features that are not exposed via this GitHub Action.
128+
- <a name="__input_flags"></a><a href="#user-content-__input_flags"><code>flags</code></a>: _(Optional)_ Space separate list of additional Cloud Functions flags to pass to the
129+
deploy command. This can be used to apply advanced features that are not
130+
exposed via this GitHub Action.
106131

107132
```yaml
108133
with:
109134
flags: '--ignore-file=...'
110135
```
111136

112-
See the [complete list of flags](https://cloud.google.com/sdk/gcloud/reference/app/deploy#FLAGS) for more information.
137+
Flags that include other flags must quote the _entire_ outer flag value. For
138+
example, to pass `--args=-X=123`:
113139

114-
---
140+
```yaml
141+
with:
142+
flags: 'flags: '--ignore-file=...' "--args=-X=123"'
143+
```
144+
145+
See the [complete list of
146+
flags](https://cloud.google.com/sdk/gcloud/reference/app/deploy#FLAGS) for
147+
more information.
148+
149+
Please note, this GitHub Action does not parse or validate the flags. You
150+
are responsible for making sure the flags are available on the gcloud
151+
version and subcommand.
115152

116-
- `gcloud_version`: (Optional) Version of the gcloud CLI to use. The default value is `latest`.
153+
- <a name="__input_gcloud_version"></a><a href="#user-content-__input_gcloud_version"><code>gcloud_version</code></a>: _(Optional)_ Version of the Cloud SDK to install. If unspecified or set to "latest",
154+
the latest available gcloud SDK version for the target platform will be
155+
installed. Example: "290.0.1".
117156

118-
- `gcloud_component`: (Optional) Component of the gcloud CLI to use. Valid
119-
values are `alpha` and `beta`. The default value is to use the stable track.
157+
- <a name="__input_gcloud_component"></a><a href="#user-content-__input_gcloud_component"><code>gcloud_component</code></a>: _(Optional)_ Version of the Cloud SDK components to install and use. If unspecified,
158+
the latest or released version will be used. This is the equivalent of
159+
running 'gcloud alpha COMMAND' or 'gcloud beta COMMAND'. Valid values are
160+
`alpha` or `beta`. The default value is to use the stable track.
161+
162+
163+
<!-- END_AUTOGEN_INPUTS -->
120164

121165
### app.yaml customizations
122166

@@ -126,21 +170,25 @@ for more information.
126170

127171
## Outputs
128172

129-
- `name`: The fully-qualified resource name of the deployment. This will be of
130-
the format "apps/<project>/services/<service>/versions/<version>".
173+
<!-- BEGIN_AUTOGEN_OUTPUTS -->
174+
175+
- <a name="__output_name"></a><a href="#user-content-__output_name"><code>name</code></a>: The fully-qualified resource name of the deployment. This will be of the
176+
format `apps/[PROJECT]/services/[SERVICE]/versions/[VERSION]`.
177+
178+
- <a name="__output_runtime"></a><a href="#user-content-__output_runtime"><code>runtime</code></a>: The computed deployment runtime.
179+
180+
- <a name="__output_service_account_email"></a><a href="#user-content-__output_service_account_email"><code>service_account_email</code></a>: The email address of the runtime service account.
131181

132-
- `runtime`: The computed deployment runtime.
182+
- <a name="__output_serving_status"></a><a href="#user-content-__output_serving_status"><code>serving_status</code></a>: The current serving status. The value is usually "SERVING", unless the
183+
deployment failed to start.
133184

134-
- `service_account_email`: The email address of the runtime service account.
185+
- <a name="__output_version_id"></a><a href="#user-content-__output_version_id"><code>version_id</code></a>: Unique identifier for the version, or the specified version if one was
186+
given.
135187

136-
- `serving_status`: The current serving status. The value is usually
137-
"SERVING", unless the deployment failed to start.
188+
- <a name="__output_version_url"></a><a href="#user-content-__output_version_url"><code>version_url</code></a>: URL of the version of the AppEngine service that was deployed.
138189

139-
- `version_id`: Unique identifier for the version, or the specified version if
140-
one was given.
141190

142-
- `version_url`: URL of the version of the AppEngine service that was
143-
deployed.
191+
<!-- END_AUTOGEN_OUTPUTS -->
144192

145193
## Authorization
146194

action.yml

Lines changed: 91 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,91 @@ description: |-
66
inputs:
77
project_id:
88
description: |-
9-
The Google Cloud Project ID. If unspecified, it is inherited from the
10-
environment.
9+
ID of the Google Cloud project. If not provided, this is inherited from
10+
the environment.
1111
required: false
1212

1313
working_directory:
1414
description: |-
15-
The path to set the working directory. The deliverables will be referenced
16-
from this path.
15+
The working directory to use. **GitHub Actions do not honor [default
16+
working-directory
17+
settings](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaultsrun).**
18+
The `deliverables` input is a relative path based on this setting.
1719
required: false
1820

1921
deliverables:
2022
description: |-
21-
The yaml files for the services or configurations you want to deploy.
22-
If not given, defaults to app.yaml in the current directory. If that is
23-
not found, attempts to automatically generate necessary configuration
24-
files (such as app.yaml) in the current directory.
23+
The [yaml
24+
files](https://cloud.google.com/appengine/docs/standard/nodejs/configuration-files#optional_configuration_files)
25+
for the services or configurations you want to deploy. If not given,
26+
defaults to app.yaml in the current directory. If that is not found,
27+
attempts to automatically generate necessary configuration files (such as
28+
app.yaml) in the current directory (example, `app.yaml cron.yaml`).
29+
30+
Note: The additional deliverables may require additional roles for your
31+
service account user.
2532
required: false
2633

2734
build_env_vars:
2835
description: |-
29-
List of key=value pairs to set as environment variables during tbe build
30-
process. This will overwrite any duplicate key environment variables
31-
defined in the app.yaml.
36+
List of build environment variables that should be set in the build
37+
environment. These are comma-separated or newline-separated `KEY=VALUE`.
38+
Keys or values that contain separators must be escaped with a backslash
39+
(e.g. `\,` or `\\n`) unless quoted. Any leading or trailing whitespace is
40+
trimmed unless values are quoted.
41+
42+
```yaml
43+
build_env_vars: |-
44+
FRUIT=apple
45+
SENTENCE=" this will retain leading and trailing spaces "
46+
```
47+
48+
This value will only be set if the input is a non-empty value. If a
49+
non-empty value is given, the field values will be overwritten (not
50+
merged). To remove all values, set the value to the literal string `{}`.
51+
52+
To include build environment variables defined in another file, use the
53+
[`includes` directive][includes-directive] in your `app.yaml`.
54+
55+
This will overwrite any duplicate key environment variables defined in the
56+
`app.yaml`.
3257
required: false
3358

3459
env_vars:
3560
description: |-
36-
List of key=value pairs to set as environment variables. This will
37-
overwrite any duplicate key environment variables defined in the app.yaml.
61+
List of environment variables that should be set in the environment. These
62+
are comma-separated or newline-separated `KEY=VALUE`. Keys or values that
63+
contain separators must be escaped with a backslash (e.g. `\,` or `\\n`)
64+
unless quoted. Any leading or trailing whitespace is trimmed unless values
65+
are quoted.
66+
67+
```yaml
68+
env_vars: |-
69+
FRUIT=apple
70+
SENTENCE=" this will retain leading and trailing spaces "
71+
```
72+
73+
This value will only be set if the input is a non-empty value. If a
74+
non-empty value is given, the field values will be overwritten (not
75+
merged). To remove all values, set the value to the literal string `{}`.
76+
77+
To include environment variables defined in another file, use the
78+
[`includes` directive][includes-directive] in your `app.yaml`.
79+
80+
This will overwrite any duplicate key environment variables defined in the
81+
`app.yaml`.
3882
required: false
3983

4084
image_url:
4185
description: |-
42-
Deploy with a specific container image. The image URL must be from one of
43-
the valid GCR host names.
86+
Fully-qualified name
87+
of the container image to deploy. For example:
88+
89+
us-docker.pkg.dev/cloudrun/container/hello:latest
90+
91+
or
92+
93+
us-docker.pkg.dev/my-project/my-container/image:1.2.3
4494
required: false
4595

4696
version:
@@ -58,9 +108,30 @@ inputs:
58108

59109
flags:
60110
description: |-
61-
Space separated list of other App Engine flags, examples can be found:
62-
https://cloud.google.com/sdk/gcloud/reference/app/deploy#FLAGS. Ex
63-
[email protected] --no-cache
111+
Space separate list of additional Cloud Functions flags to pass to the
112+
deploy command. This can be used to apply advanced features that are not
113+
exposed via this GitHub Action.
114+
115+
```yaml
116+
with:
117+
flags: '--ignore-file=...'
118+
```
119+
120+
Flags that include other flags must quote the _entire_ outer flag value. For
121+
example, to pass `--args=-X=123`:
122+
123+
```yaml
124+
with:
125+
flags: 'flags: '--ignore-file=...' "--args=-X=123"'
126+
```
127+
128+
See the [complete list of
129+
flags](https://cloud.google.com/sdk/gcloud/reference/app/deploy#FLAGS) for
130+
more information.
131+
132+
Please note, this GitHub Action does not parse or validate the flags. You
133+
are responsible for making sure the flags are available on the gcloud
134+
version and subcommand.
64135
required: false
65136

66137
gcloud_version:
@@ -82,7 +153,7 @@ outputs:
82153
name:
83154
description: |-
84155
The fully-qualified resource name of the deployment. This will be of the
85-
format "apps/<project>/services/<service>/versions/<version>".
156+
format `apps/[PROJECT]/services/[SERVICE]/versions/[VERSION]`.
86157
87158
runtime:
88159
description: |-
@@ -106,15 +177,10 @@ outputs:
106177
description: |-
107178
URL of the version of the AppEngine service that was deployed.
108179
109-
url:
110-
description: |-
111-
DEPRECATED: Use "version_url" instead. URL of the version of the AppEngine
112-
service that was deployed.
113-
114180
branding:
115181
icon: 'code'
116182
color: 'blue'
117183

118184
runs:
119185
using: 'node24'
120-
main: 'dist/index.js'
186+
main: 'dist/main/index.js'

dist/index.js renamed to dist/main/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.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "Github Action: Deploy to Google App Engine",
55
"main": "dist/index.js",
66
"scripts": {
7-
"build": "ncc build -m src/main.ts",
7+
"build": "rm -rf dist/ && ncc build -m src/main.ts -o dist/main",
8+
"docs": "./node_modules/.bin/actions-gen-readme",
89
"lint": "eslint .",
910
"format": "eslint . --fix",
1011
"test": "node --require ts-node/register --test-reporter spec --test tests/**/*.test.ts"

0 commit comments

Comments
 (0)