Skip to content

Commit

Permalink
Add workflows to configure oauth config
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinbuss committed Sep 17, 2024
1 parent ebf5b62 commit 469baa3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/_terraformDestroyTemplate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ on:
CLIENT_SECRET:
required: true
description: "Specifies the client secret."
BOT_OAUTH_CLIENT_ID:
required: true
description: "Specifies the client id of the app used for the bot oauth."
BOT_OAUTH_CLIENT_SECRET:
required: true
description: "Specifies the client secret of the app used for the bot oauth."

permissions:
id-token: write
Expand Down Expand Up @@ -95,3 +101,5 @@ jobs:
terraform apply -var-file="../../config/${CONFIG}/vars.tfvars" -auto-approve -input=false -destroy
env:
CONFIG: ${{ inputs.config }}
TF_VAR_bot_oauth_client_id: ${{ secrets.BOT_OAUTH_CLIENT_ID }}
TF_VAR_bot_oauth_client_secret: ${{ secrets.BOT_OAUTH_CLIENT_SECRET }}
10 changes: 10 additions & 0 deletions .github/workflows/_terraformEnvironmentTemplate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ on:
CLIENT_SECRET:
required: true
description: "Specifies the client secret."
BOT_OAUTH_CLIENT_ID:
required: true
description: "Specifies the client id of the app used for the bot oauth."
BOT_OAUTH_CLIENT_SECRET:
required: true
description: "Specifies the client secret of the app used for the bot oauth."

permissions:
id-token: write
Expand Down Expand Up @@ -150,6 +156,8 @@ jobs:
terraform plan -var-file="../../config/${CONFIG}/vars.tfvars" -input=false
env:
CONFIG: ${{ inputs.config }}
TF_VAR_bot_oauth_client_id: ${{ secrets.BOT_OAUTH_CLIENT_ID }}
TF_VAR_bot_oauth_client_secret: ${{ secrets.BOT_OAUTH_CLIENT_SECRET }}

# Add Pull Request Comment
- name: Add Pull Request Comment
Expand Down Expand Up @@ -235,3 +243,5 @@ jobs:
terraform apply -var-file="../../config/${CONFIG}/vars.tfvars" -auto-approve -input=false
env:
CONFIG: ${{ inputs.config }}
TF_VAR_bot_oauth_client_id: ${{ secrets.BOT_OAUTH_CLIENT_ID }}
TF_VAR_bot_oauth_client_secret: ${{ secrets.BOT_OAUTH_CLIENT_SECRET }}
4 changes: 4 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
secrets:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
BOT_OAUTH_CLIENT_ID: ${{ secrets.BOT_OAUTH_CLIENT_ID }}
BOT_OAUTH_CLIENT_SECRET: ${{ secrets.BOT_OAUTH_CLIENT_SECRET }}

terraform_dev_destroy:
uses: ./.github/workflows/_terraformDestroyTemplate.yml
Expand All @@ -49,3 +51,5 @@ jobs:
secrets:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
BOT_OAUTH_CLIENT_ID: ${{ secrets.BOT_OAUTH_CLIENT_ID }}
BOT_OAUTH_CLIENT_SECRET: ${{ secrets.BOT_OAUTH_CLIENT_SECRET }}

0 comments on commit 469baa3

Please sign in to comment.