From 7e635948ca27ad09e95f38d7c79209606e0d6d28 Mon Sep 17 00:00:00 2001 From: David Bloss Date: Tue, 10 Dec 2024 15:33:24 -0600 Subject: [PATCH 1/2] fix custom action workflow --- .github/workflows/custom_action.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/custom_action.yaml b/.github/workflows/custom_action.yaml index 150c5e8..0bd3b5d 100644 --- a/.github/workflows/custom_action.yaml +++ b/.github/workflows/custom_action.yaml @@ -32,11 +32,18 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Setup OpsLevel CLI uses: opslevel/actions/setup-cli@v1 - - name: Apply Terraform + - name: Mask inputs run: | echo "::add-mask::$OPSLEVEL_API_TOKEN" echo "::add-mask::$SANDBOX_USER_EMAIL" - export OPSLEVEL_API_TOKEN=$(jq -r 'select(.client_payload.api_token or .inputs.api_token)' $GITHUB_EVENT_PATH) - export SANDBOX_USER_EMAIL=$(jq -r 'select(.client_payload.user_email or .inputs.user_email)' $GITHUB_EVENT_PATH) + OPSLEVEL_API_TOKEN=$(jq -r 'select(.client_payload.api_token or .inputs.api_token)' $GITHUB_EVENT_PATH) + SANDBOX_USER_EMAIL=$(jq -r 'select(.client_payload.user_email or .inputs.user_email)' $GITHUB_EVENT_PATH) + echo "OPSLEVEL_API_TOKEN=$OPSLEVEL_API_TOKEN" >> $GITHUB_ENV + echo "SANDBOX_USER_EMAIL=$SANDBOX_USER_EMAIL" >> $GITHUB_ENV + - name: Apply Terraform + env: + OPSLEVEL_API_TOKEN: "${{ env.OPSLEVEL_API_TOKEN }}" + SANDBOX_USER_EMAIL: "${{ env.SANDBOX_USER_EMAIL }}" + run: | task factory-reset -y task apply-demo -- -auto-approve From c3bd29152c8642896b7b61b9b73579aa4ba4c670 Mon Sep 17 00:00:00 2001 From: David Bloss Date: Tue, 10 Dec 2024 15:34:53 -0600 Subject: [PATCH 2/2] update custom action workflow --- .github/workflows/custom_action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/custom_action.yaml b/.github/workflows/custom_action.yaml index 0bd3b5d..b253555 100644 --- a/.github/workflows/custom_action.yaml +++ b/.github/workflows/custom_action.yaml @@ -34,10 +34,10 @@ jobs: uses: opslevel/actions/setup-cli@v1 - name: Mask inputs run: | - echo "::add-mask::$OPSLEVEL_API_TOKEN" - echo "::add-mask::$SANDBOX_USER_EMAIL" OPSLEVEL_API_TOKEN=$(jq -r 'select(.client_payload.api_token or .inputs.api_token)' $GITHUB_EVENT_PATH) SANDBOX_USER_EMAIL=$(jq -r 'select(.client_payload.user_email or .inputs.user_email)' $GITHUB_EVENT_PATH) + echo "::add-mask::$OPSLEVEL_API_TOKEN" + echo "::add-mask::$SANDBOX_USER_EMAIL" echo "OPSLEVEL_API_TOKEN=$OPSLEVEL_API_TOKEN" >> $GITHUB_ENV echo "SANDBOX_USER_EMAIL=$SANDBOX_USER_EMAIL" >> $GITHUB_ENV - name: Apply Terraform