Skip to content

Commit b2302e3

Browse files
CR-12940-poor-env (#53)
* CR-12940 use one encoded env varible to docker Co-authored-by: Saffi <saffi.hartal@codefresh.io>
1 parent cb3dcf1 commit b2302e3

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
VERSION:
55
description: specify client version
66
required: false
7-
default: 0.0.70
7+
default: 0.0.71
88
CF_API_KEY:
99
description: "Codefresh API KEY"
1010
required: true
@@ -156,7 +156,7 @@ runs:
156156
echo "CF_WORKFLOW_URL=$CF_WORKFLOW_URL" >> cf_env
157157
echo "CF_GIT_PROVIDER=${CF_GIT_PROVIDER}" >> cf_env
158158
# EXTERNAL_ENV=$(jq -n 'env'|base64)
159-
# echo "EXTERNAL_ENV=$EXTERNAL_ENV">cf_env
159+
echo "EXTERNAL_ENV=$EXTERNAL_ENV">>cf_env
160160
161161
docker run --env-file=cf_env "quay.io/codefresh/codefresh-report-image:$VERSION"
162162

service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name: csdp-report-image
2-
version: 0.0.70
2+
version: 0.0.71
33

src/validate.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { atob } from 'buffer'
66
*/
77
export function validate(payload: Record<string, string|undefined>): Record<string, string|undefined> {
88
if (payload['EXTERNAL_ENV']) {
9-
payload = JSON.parse(atob(payload['EXTERNAL_ENV']))
9+
try {
10+
payload = JSON.parse(atob(payload['EXTERNAL_ENV']))
11+
} catch (error) {
12+
console.log(`could not handle ${JSON.stringify(payload['EXTERNAL_ENV'])} , Error ${JSON.stringify(error)} `)
13+
}
1014
}
1115
const filtered = filterEnvVarPattern(payload)
1216
const messages: string[] = []

0 commit comments

Comments
 (0)