Skip to content

Commit

Permalink
fix(main.ts): removed false default value for releaseName
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-ra committed Jul 26, 2023
1 parent 82f4492 commit 53d0746
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
3 changes: 1 addition & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ inputs:
description: 'Kubernetes config file to connect'

releaseName:
required: false
required: true
description: 'The name of your release'
default: ${{ github.repository.name }}

valuesPath:
required: false
Expand Down
16 changes: 11 additions & 5 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions src/handlers/deploy-helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ export async function deployHelmChart(config: {
}): Promise<void> {
try {
core.info('Deploying the helm')
const namespaceFlag = config.namespace
? `--namespace ${config.namespace}`
: ''

execSync(
`helm upgrade --install --timeout 180s ${config.releaseName} ${
config.addedHelmRepositoryName
}/${config.chartName} -f ${config.valuesPath} --version ${
config.chartVersion
} ${
config?.namespace ? `--namespace ${config.namespace}` : ''
} --kubeconfig kubeconfig`,
`helm upgrade --install --timeout 180s ${config.releaseName} ${config.addedHelmRepositoryName}/${config.chartName} -f ${config.valuesPath} --version ${config.chartVersion} ${namespaceFlag} --kubeconfig kubeconfig`,
{stdio: 'inherit', cwd: repositoryDirectory}
)

Expand Down
11 changes: 7 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ import {addHelmRepository} from './handlers/add-helm-repo'

async function run(): Promise<void> {
try {
const kubeConfig = core.getInput('kubeConfig', {required: true})
const releaseName = core.getInput('releaseName') || 'default'
const namespace = core.getInput('namespace')
const context = core.getInput('context')
const releaseName = core.getInput('releaseName', {
required: true,
trimWhitespace: true
})

const chartRemote = core.getInput('remoteRepository', {required: true})
const chartVersion = core.getInput('chartVersion', {required: true})
const kubeConfig = core.getInput('kubeConfig', {required: true})
const chartName = core.getInput('chartName', {required: true})
const namespace = core.getInput('namespace') || 'default'
const valuesPath = core.getInput('valuesPath')
const context = core.getInput('context')

await installKubectl()
await setupKubectlConfig(kubeConfig)
Expand Down

0 comments on commit 53d0746

Please sign in to comment.