diff --git a/.github/workflows/custom_action.yaml b/.github/workflows/custom_action.yaml index 5e44b3b..150c5e8 100644 --- a/.github/workflows/custom_action.yaml +++ b/.github/workflows/custom_action.yaml @@ -32,22 +32,11 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Setup OpsLevel CLI uses: opslevel/actions/setup-cli@v1 - - name: Mask Access Token - from Github - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - echo "::add-mask::$API_TOKEN" - echo "API_TOKEN=${{ github.event.inputs.api_token }}" >> $GITHUB_ENV - echo "USER_EMAIL=${{ github.event.inputs.user_email }}" >> $GITHUB_ENV - - name: Mask Access Token - from OpsLevel - if: ${{ github.event_name == 'repository_dispatch' }} - run: | - echo "::add-mask::$API_TOKEN" - echo "API_TOKEN=${{ github.event.client_payload.api_token }}" >> $GITHUB_ENV - echo "USER_EMAIL=${{ github.event.client_payload.user_email }}" >> $GITHUB_ENV - name: Apply Terraform - env: - OPSLEVEL_API_TOKEN: "${{ env.API_TOKEN }}" - SANDBOX_USER_EMAIL: "${{ env.USER_EMAIL }}" 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) task factory-reset -y task apply-demo -- -auto-approve diff --git a/modules/demo_account/users.tf b/modules/demo_account/users.tf index 837d862..daf285d 100644 --- a/modules/demo_account/users.tf +++ b/modules/demo_account/users.tf @@ -26,7 +26,8 @@ module "people" { resource "opslevel_user" "user" { for_each = { for user in var.account_users : split("@", user)[0] => user } - name = each.value - email = each.value - role = "admin" + name = each.value + email = each.value + role = "admin" + skip_welcome_email = false }