Skip to content

Commit f6d5bd8

Browse files
authored
feat: add timeout flag ✨ (#14)
1 parent 41fb8d7 commit f6d5bd8

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
chart-dir: ./helm
1414
chmod-kubeconfig: "1" # `chmod 600 kubeconfig-filepath`
1515
cleanup: "1" # delete all the files i.e. kubeconfig & values
16+
cleanup-on-fail: "1" # delete newly created resources on failure
1617
create-namespace: "0"
1718
helm-version: "v3.10.1" # https://github.com/helm/helm/releases
1819
namespace: default
1920
release-name: ${{ github.event.repository.name }}
21+
timeout: 10m
2022
update-dependencies: "1" # helm dep update
2123
values: image.tag=${{ github.sha }} # comma separated key=value pairs
2224
values-string: key1=value1,key2=value2 # comma separated key=value pairs

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ inputs:
2929
default: "1"
3030
description: Whether or not to delete all the kubeconfig & values files after deployment
3131
required: false
32+
cleanup-on-fail:
33+
default: "1"
34+
description: Whether or not to delete all the newly created resources on failure
35+
required: false
3236
create-namespace:
3337
default: "0"
3438
description: Whether or not to pass `--create-namespace` to Helm
@@ -48,6 +52,9 @@ inputs:
4852
release-name:
4953
default: ${{ github.event.repository.name }}
5054
required: false
55+
timeout:
56+
default: 10m
57+
description: The maximum amount of time to wait for the deployment to complete
5158
update-dependencies:
5259
default: "1"
5360
description: Whether or not to run `helm dependency update` before deployment
@@ -133,9 +140,11 @@ runs:
133140
helm ${{ inputs.action }} ${{ inputs.release-name }} ${{ inputs.chart-dir }} \
134141
--kubeconfig ${{ inputs.kubeconfig-filepath || steps.generate-random-filepath.outputs.KUBECONFIG_FILEPATH }} \
135142
--namespace ${{ inputs.namespace }} \
143+
--timeout ${{ inputs.timeout }} \
136144
$([[ "${{ inputs.create-namespace }}" == "1" ]] && echo '--create-namespace') \
137145
$([[ "${{ inputs.atomic }}" == "1" ]] && echo '--atomic') \
138146
$([[ "${{ inputs.wait }}" == "1" ]] && echo '--wait') \
147+
$([[ "${{ inputs.cleanup-on-fail }}" == "1" ]] && echo '--cleanup-on-fail') \
139148
$([[ "${{ inputs.values-file }}" != "" ]] && echo "--values ${{ github.run_id }}") \
140149
$([[ "${{ inputs.values-filepath }}" != "" ]] && echo "--values ${{ inputs.values-filepath }}") \
141150
$([[ "${{ inputs.values }}" != "" ]] && echo "--set ${{ inputs.values }}") \

0 commit comments

Comments
 (0)