From 8f80224a15561a8c5e7070add9cc677be8aad7fe Mon Sep 17 00:00:00 2001 From: Sumu Date: Thu, 19 Oct 2023 14:08:59 -0400 Subject: [PATCH] laksdjbfn Signed-off-by: Sumu --- .../bump-latest-cdk8s-plus-library.yml | 6 ++++ src/k8s-automation.ts | 12 +++++++ ...tingModeScript.sh => setTestingModeVar.sh} | 33 ++++++++++++++----- 3 files changed, 43 insertions(+), 8 deletions(-) rename src/{testingModeScript.sh => setTestingModeVar.sh} (56%) diff --git a/.github/workflows/bump-latest-cdk8s-plus-library.yml b/.github/workflows/bump-latest-cdk8s-plus-library.yml index aa60c17e94..141ba6ae93 100644 --- a/.github/workflows/bump-latest-cdk8s-plus-library.yml +++ b/.github/workflows/bump-latest-cdk8s-plus-library.yml @@ -24,7 +24,13 @@ jobs: latestVersion: ${{ steps.k8s-latest-version.outputs.latestVersion }} currentVersion: ${{ steps.k8s-current-version.outputs.currentVersion }} httpStatus: ${{ steps.get-npm-status-code.outputs.httpStatus }} + env: + testingMode: "true" steps: + - name: Set testingMode env variable + run: bash src/setTestingModeVar.sh ${{ github.event.inputs.testingMode }} + - name: PRINT testing mode var + run: echo env.testingMode - name: Get latest K8s Release id: get-k8s-latest-release uses: pozetroninc/github-action-get-latest-release@master diff --git a/src/k8s-automation.ts b/src/k8s-automation.ts index 33fe4251e5..13e3607a27 100644 --- a/src/k8s-automation.ts +++ b/src/k8s-automation.ts @@ -62,7 +62,19 @@ export class K8sVersionUpgradeAutomation extends Component { outputName: 'httpStatus', }, }, + env: { + testingMode: 'true', + }, steps: [ + { + name: 'Set testingMode env variable', + run: 'bash src/setTestingModeVar.sh ${{ github.event.inputs.testingMode }}', + }, + { + name: 'PRINT testing mode var', + run: 'echo env.testingMode', + }, + { id: 'get-k8s-latest-release', name: 'Get latest K8s Release', diff --git a/src/testingModeScript.sh b/src/setTestingModeVar.sh similarity index 56% rename from src/testingModeScript.sh rename to src/setTestingModeVar.sh index ecb0a068fc..4ae25928ad 100644 --- a/src/testingModeScript.sh +++ b/src/setTestingModeVar.sh @@ -1,16 +1,33 @@ #!/bin/bash -export githubEvent="$1" -export testingMode="$2" -# if [ "$githubEvent" = "push" ]; then +TESTING_MODE_INPUT="$1" +# Use user input or fall back to "true" +echo testingMode=${TESTING_MODE_INPUT:-"true"} >> $GITHUB_ENV +# use $NAME in your action, value will be always provided + + + + + + +# export githubEvent="$1" +# export testingMode="$2" + +# # if [ "$githubEvent" = "push" ]; then +# # echo labels="auto-approve" >> $GITHUB_OUTPUT +# # fi + +# if [ "$testingMode" = "false" ]; then # echo labels="auto-approve" >> $GITHUB_OUTPUT +# else +# echo labels="" >> $GITHUB_OUTPUT # fi -if [ "$testingMode" = "false" ]; then - echo labels="auto-approve" >> $GITHUB_OUTPUT -else - echo labels="" >> $GITHUB_OUTPUT -fi + + + + + # if [[$testingMode]]; then # echo labels="auto-approve" >> $GITHUB_OUTPUT