-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 1.33 KB
/
pull_request.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: CI & Plan
on:
pull_request:
jobs:
build:
# The permissions are necessary for the google-github-actions/auth@v2 action
permissions:
contents: read
id-token: write
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.STATE_BUCKET_ACCESS_WIF_PROVIDER }}
service_account: ${{ secrets.STATE_SERVICE_ACCOUNT_ID }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Which user am I ?
run: gcloud config list account --format "value(core.account)"
- uses: hashicorp/setup-terraform@v3
- name: Use gcloud CLI
run: |
gcloud info
- id: init
env:
TF_VAR_github_token: ${{ secrets.API_ACCESS_TOKEN }}
TF_VAR_project_id: ${{ secrets.GCP_PROJECT_ID }}
TF_IN_AUTOMATION: 'true'
run: |
terraform init -input=false -backend-config="prefix=bootstrap" -backend-config="bucket=lpt-schulung-bucket-tfstate"
- id: plan
run: terraform plan -no-color
- run: echo ${{ steps.plan.outputs.stdout }}
- run: echo ${{ steps.plan.outputs.stderr }}
- run: echo ${{ steps.plan.outputs.exitcode }}