1010 - dev
1111 workflow_dispatch :
1212
13+ env :
14+ OPENTOFU_VERSION : ' 1.11.5'
15+
1316concurrency :
1417 group : cloudflare-infra
1518 cancel-in-progress : false
2023 runs-on : ubuntu-latest
2124 permissions :
2225 contents : read
26+ pull-requests : write
2327 env :
2428 CLOUDFLARE_API_TOKEN : ${{ secrets.TF_CLOUDFLARE_API_TOKEN }}
29+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2530 TF_VAR_account_id : ${{ secrets.TF_VAR_ACCOUNT_ID }}
2631 TF_VAR_zone_id : ${{ secrets.TF_VAR_ZONE_ID }}
2732 TF_HTTP_ADDRESS : ${{ secrets.TF_HTTP_ADDRESS }}
4954 printf 'TF_VAR_workers_message=%s\n' "$workers_message" >> "$GITHUB_ENV"
5055
5156 - name : Setup node
52- uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2 .0
57+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3 .0
5358 with :
5459 node-version-file : ' .node-version'
5560 cache : ' npm'
6570 - name : Setup OpenTofu
6671 uses : opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8
6772 with :
68- tofu_version : 1.11.5
73+ tofu_version : ${{ env.OPENTOFU_VERSION }}
6974
7075 - name : Check formatting
7176 run : tofu fmt -check
7681 - name : Validate configuration
7782 run : tofu validate -no-color
7883
79- - name : Plan infrastructure
80- run : tofu plan -input=false -lock=false -no-color
84+ - name : Comment PR plan
85+ uses : dflook/tofu-plan@3f5dc358343fb58cd60f83b019e810315aa8258f # v2.2.3
86+ with :
87+ path : infra/web
88+ label : production
8189
8290 apply :
8391 if : (github.event_name == 'push' && github.ref_name == 'dev') || github.event_name == 'workflow_dispatch'
@@ -113,7 +121,7 @@ jobs:
113121 printf 'TF_VAR_workers_message=%s\n' "$workers_message" >> "$GITHUB_ENV"
114122
115123 - name : Setup node
116- uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2 .0
124+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3 .0
117125 with :
118126 node-version-file : ' .node-version'
119127 cache : ' npm'
@@ -129,7 +137,7 @@ jobs:
129137 - name : Setup OpenTofu
130138 uses : opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8
131139 with :
132- tofu_version : 1.11.5
140+ tofu_version : ${{ env.OPENTOFU_VERSION }}
133141
134142 - name : Check formatting
135143 run : tofu fmt -check
0 commit comments