Skip to content

Commit

Permalink
update dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Uchkunev committed Jan 29, 2025
1 parent fb21050 commit 13c16ae
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 48 deletions.
42 changes: 18 additions & 24 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.

1 change: 0 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ export async function downloadStageConfig (actionCfg: ActionConfiguration): Prom
stageConfigPath = actionCfg.customStageConditionsPath
} else {
info('using default stage conditions')
// TODO: maybe get it from stage-config.json ?
stageConfigPath = await getEnterpriseConfigUrl(
STAGE_CONFIG,
actionCfg.gitHubEnterpriseApi,
Expand Down
4 changes: 1 addition & 3 deletions src/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export async function runContainers (actionCfg: ActionConfiguration, ctxConfig:

export async function startContainer (actionCfg: ActionConfiguration, ctxConfig: any): Promise<void> {
const dockerImage = actionCfg.dockerImage !== '' ? actionCfg.dockerImage : ctxConfig.dockerImage
if (dockerImage === undefined || dockerImage === '') {
return
}
if (dockerImage === undefined || dockerImage === '') return

const piperPath = internalActionVariables.piperBinPath
const containerID = uuidv4()
Expand Down
5 changes: 1 addition & 4 deletions src/enterprise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export function onGitHubEnterprise (): boolean {

export async function getEnterpriseConfigUrl (configType: string, apiURL: string, version: string, token: string, owner: string, repository: string): Promise<string> {
debug('Getting enterprise config URL')
if (configType !== DEFAULT_CONFIG && configType !== STAGE_CONFIG) {
return ''
}
if (configType !== DEFAULT_CONFIG && configType !== STAGE_CONFIG) return ''

debug('initiating assetName and filename')
let assetName: string = ENTERPRISE_DEFAULTS_FILENAME_ON_RELEASE
Expand All @@ -37,7 +35,6 @@ export async function getEnterpriseConfigUrl (configType: string, apiURL: string
filename = ENTERPRISE_STAGE_CONFIG_FILENAME
}

debug('Getting enterprise config URL')
// if version starts with devel: then it should use inner source Piper
if (version.startsWith('devel:')) {
debug(`version starts with "devel:" => ${version}`)
Expand Down
27 changes: 13 additions & 14 deletions src/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,20 @@ export async function executePiper (
.catch(err => {
throw new Error(`Piper execution error: ${err as string}: ${piperError}`)
})
} else {
return await exec('docker', [
'exec',
containerID,
}
return await exec('docker', [
'exec',
containerID,
`/piper/${path.basename(piperPath)}`,
stepName,
...flags
], options).then(exitCode => {
return {
output: piperOutput,
error: piperError,
exitCode
}
}).catch(err => {
throw new Error(`Piper execution error: ${err as string}: ${piperError}`)
})
}
], options).then(exitCode => {
return {
output: piperOutput,
error: piperError,
exitCode
}
}).catch(err => {
throw new Error(`Piper execution error: ${err as string}: ${piperError}`)
})
}
2 changes: 1 addition & 1 deletion src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function fetchRetry (url: string, method = 'GET', tries = 5, baseDe
await wait(delayTime)
}
}
return await Promise.reject(new Error(`Error fetching ${url}`))
throw new Error(`Error fetching ${url}`)
}

function isRetryable (code: number): boolean {
Expand Down

0 comments on commit 13c16ae

Please sign in to comment.