-
Notifications
You must be signed in to change notification settings - Fork 11
69 lines (64 loc) · 2.16 KB
/
generate-config-out.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
# This workflow is optional
name: Generate code by terraform plan -generate-config-out
run-name: Generate code by terraform plan -generate-config-out (${{inputs.working_dir}})
on:
workflow_dispatch:
inputs:
working_dir:
description: working directory
required: true
file:
description: file name
required: true
branch:
description: branch name
required: true
env:
TFACTION_WORKING_DIR: ${{github.event.inputs.working_dir}}
TFACTION_JOB_TYPE: terraform
FILE: ${{inputs.file}}
BRANCH: ${{inputs.branch}}
jobs:
import:
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
id-token: write # For OIDC
contents: read # For checkout a private repository
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{inputs.branch}}
persist-credentials: false
- uses: aquaproj/aqua-installer@f13c5d2f0357708d85477aabe50fd3f725528745 # v3.1.0
with:
aqua_version: v2.42.2
working_directory: ${{env.TFACTION_WORKING_DIR}}
env:
AQUA_GITHUB_TOKEN: ${{github.token}}
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{secrets.APP_ID}}
private_key: ${{secrets.APP_PRIVATE_KEY}}
# contents:write - Push commits
permissions: >-
{
"pull_requests": "write",
"contents": "write"
}
repositories: >-
["${{github.event.repository.name}}"]
- uses: suzuki-shunsuke/tfaction/setup@d4b16993b0b434b36c1a94c25c2fcb0c18d867d4 # v1.15.0
id: setup
with:
github_token: ${{steps.generate_token.outputs.token}}
- uses: suzuki-shunsuke/tfaction/generate-config-out@d4b16993b0b434b36c1a94c25c2fcb0c18d867d4 # v1.15.0
env:
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}}
with:
github_token: ${{steps.generate_token.outputs.token}}
branch: ${{inputs.branch}}
file: ${{inputs.file}}