Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mask inputs in github workflow #52

Merged
merged 5 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions .github/workflows/custom_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions modules/demo_account/users.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Loading