sandbox #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Create Sandbox" | |
on: | |
repository_dispatch: | |
types: | |
- sandbox | |
workflow_dispatch: | |
inputs: | |
api_token: | |
description: "The API token of the sandbox account to Terraform apply to." | |
type: string | |
required: true | |
user_email: | |
description: "Email address to send invite to." | |
type: string | |
required: true | |
jobs: | |
handler: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: "~1.10.0" | |
- name: Install Task | |
uses: arduino/setup-task@v2 | |
with: | |
version: 3.x | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup OpsLevel CLI | |
uses: opslevel/actions/setup-cli@v1 | |
- name: Mask inputs | |
run: | | |
OPSLEVEL_API_TOKEN=$(jq -r '.client_payload.api_token // .inputs.api_token' $GITHUB_EVENT_PATH) | |
SANDBOX_USER_EMAIL=$(jq -r '.client_payload.user_email // .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 | |
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 | |
task install-sample-integration |