Skip to content

Commit b27e73f

Browse files
authored
Update linters (#19)
1 parent bf070d9 commit b27e73f

File tree

4 files changed

+39
-32
lines changed

4 files changed

+39
-32
lines changed

.github/workflows/integration.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ permissions:
3535

3636
jobs:
3737
integration:
38-
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
38+
if: |-
39+
${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
3940
runs-on: 'ubuntu-latest'
4041
steps:
4142
- uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
@@ -65,6 +66,8 @@ jobs:
6566
project_id: '${{ vars.PROJECT_ID }}'
6667

6768
- name: 'get-deployment'
68-
shell: bash
69+
shell: 'bash'
70+
env:
71+
NAMESPACE: '${{ vars.NAMESPACE }}'
6972
run: |
70-
kubectl get deployment -n ${{ vars.NAMESPACE }}
73+
kubectl get deployment -n "${NAMESPACE}"

action.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Deploy GKE
15+
name: 'Deploy GKE'
1616
description: |-
1717
Use gke-deploy cli to deploy an image
18-
author: Google LLC
18+
author: 'Google LLC'
1919

2020
inputs:
2121
image:
@@ -46,12 +46,12 @@ inputs:
4646
namespace:
4747
description: |-
4848
Namespace of GKE cluster to deploy to.
49-
If not provided, it will not be passed to the binary.
49+
If not provided, it will not be passed to the binary.
5050
required: false
5151

5252
expose:
5353
description: |-
54-
The port provided will be used to expose the deployed workload object (i.e., port and targetPort will be set to the value provided in this flag).
54+
The port provided will be used to expose the deployed workload object (i.e., port and targetPort will be set to the value provided in this flag).
5555
If not provided, it will not be passed to the binary.
5656
required: false
5757

@@ -70,10 +70,10 @@ runs:
7070
using: 'docker'
7171
image: 'Dockerfile'
7272
args:
73-
- ${{ inputs.image }}
74-
- ${{ inputs.app_name }}
75-
- ${{ inputs.region }}
76-
- ${{ inputs.cluster_name }}
77-
- ${{ inputs.project_id }}
78-
- ${{ inputs.namespace }}
79-
- ${{ inputs.expose }}
73+
- '${{ inputs.image }}'
74+
- '${{ inputs.app_name }}'
75+
- '${{ inputs.region }}'
76+
- '${{ inputs.cluster_name }}'
77+
- '${{ inputs.project_id }}'
78+
- '${{ inputs.namespace }}'
79+
- '${{ inputs.expose }}'

entrypoint.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,39 @@
1616

1717
gha_version="0.1.0"
1818

19-
image="$1"
20-
app_name="$2"
21-
location="$3"
22-
cluster_name="$4"
23-
project_id="$5"
24-
namespace="$6"
25-
expose_port="$7"
26-
k8s_manifests="$8"
19+
image="${1}"
20+
app_name="${2}"
21+
location="${3}"
22+
cluster_name="${4}"
23+
project_id="${5}"
24+
namespace="${6}"
25+
expose_port="${7}"
26+
k8s_manifests="${8}"
2727

28-
gke_deploy_command="gke-deploy run -i $image -a $app_name -l $location -c $cluster_name -p $project_id"
28+
gke_deploy_command="gke-deploy run -i ${image} -a ${app_name} -l ${location} -c ${cluster_name} -p ${project_id}"
2929

3030
# Ensure all required variables are provided by workflow users.
31-
if [ -z "$image" ] || [ -z "$app_name" ] || [ -z "$location" ] || [ -z "$cluster_name" ] || [ -z "$project_id" ]; then
31+
if [ -z "${image}" ] || [ -z "${app_name}" ] || [ -z "${location}" ] || [ -z "${cluster_name}" ] || [ -z "${project_id}" ]; then
3232
echo "Error: Required variables (image, app_name, location, cluster_name, project_id) are not set."
3333
exit 1
3434
fi
3535

3636
# Add namespace if the input is apparent.
37-
if [ -n "$namespace" ]; then
38-
gke_deploy_command="$gke_deploy_command -n $namespace"
37+
if [ -n "${namespace}" ]; then
38+
gke_deploy_command="${gke_deploy_command} -n ${namespace}"
3939
fi
4040

4141
# Add expose port if the input is apparent.
42-
if [ -n "$expose_port" ]; then
43-
gke_deploy_command="$gke_deploy_command -x $expose_port"
42+
if [ -n "${expose_port}" ]; then
43+
gke_deploy_command="${gke_deploy_command} -x ${expose_port}"
4444
fi
4545

4646
# Add k8s manifests file(s) if the input is apparent.
47-
if [ -n "$k8s_manifests" ]; then
48-
gke_deploy_command="$gke_deploy_command -f $k8s_manifests"
47+
if [ -n "${k8s_manifests}" ]; then
48+
gke_deploy_command="${gke_deploy_command} -f ${k8s_manifests}"
4949
fi
5050

5151
# Utilize Google APIs user agent for metrics with the following unique identifier:
52-
export GOOGLE_APIS_USER_AGENT=google-github-action:deploy-gke/$gha_version
52+
export GOOGLE_APIS_USER_AGENT="google-github-action:deploy-gke/${gha_version}"
5353

54-
$gke_deploy_command
54+
${gke_deploy_command}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "deploy-gke",
33
"version": "0.0.3",
4+
"engines": {
5+
"node": "20.x",
6+
"npm": "10.x"
7+
},
48
"scripts": {
59
"build": "exit 0"
610
}

0 commit comments

Comments
 (0)