Skip to content

Commit cd0fbe5

Browse files
authored
Add token generation for documentation rendering (#907)
1 parent 69a5b30 commit cd0fbe5

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

.github/workflows/generate-library.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
components:
3030
name: Components
3131
runs-on: ubuntu-latest
32+
environment: generate
3233
steps:
3334
- name: Checkout Repository
3435
uses: actions/checkout@v4
@@ -71,9 +72,17 @@ jobs:
7172
tag: v0.18.0
7273
cache: enable
7374

75+
- name: Generate a token
76+
id: generate-token
77+
uses: actions/create-github-app-token@v1
78+
with:
79+
app-id: ${{ vars.APP_ID }}
80+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
81+
owner: cloudposse
82+
7483
- name: Render Documentation for Terraform Components
7584
env:
76-
PUBLIC_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
85+
PUBLIC_REPO_ACCESS_TOKEN: ${{ steps.generate-token.outputs.token }}
7786
run: ./scripts/render-docs-for-components.sh
7887

7988
- name: Upload Components Docs
@@ -86,6 +95,7 @@ jobs:
8695
modules:
8796
name: Modules
8897
runs-on: ubuntu-latest
98+
environment: generate
8999
steps:
90100
- name: Checkout Repository
91101
uses: actions/checkout@v4
@@ -120,9 +130,17 @@ jobs:
120130
tag: v0.18.0
121131
cache: enable
122132

133+
- name: Generate a token
134+
id: generate-token
135+
uses: actions/create-github-app-token@v1
136+
with:
137+
app-id: ${{ vars.APP_ID }}
138+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
139+
owner: cloudposse
140+
123141
- name: Render Documentation for Terraform Modules
124142
env:
125-
PUBLIC_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
143+
PUBLIC_REPO_ACCESS_TOKEN: ${{ steps.generate-token.outputs.token }}
126144
run: ./scripts/render-docs-for-modules.sh
127145

128146
- name: Upload Modules Docs
@@ -135,6 +153,7 @@ jobs:
135153
github-actions:
136154
name: GitHub Actions
137155
runs-on: ubuntu-latest
156+
environment: generate
138157
steps:
139158
- name: Checkout Repository
140159
uses: actions/checkout@v4
@@ -169,9 +188,17 @@ jobs:
169188
tag: v0.18.0
170189
cache: enable
171190

191+
- name: Generate a token
192+
id: generate-token
193+
uses: actions/create-github-app-token@v1
194+
with:
195+
app-id: ${{ vars.APP_ID }}
196+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
197+
owner: cloudposse
198+
172199
- name: Render Documentation for GitHub Actions
173200
env:
174-
PUBLIC_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
201+
PUBLIC_REPO_ACCESS_TOKEN: ${{ steps.generate-token.outputs.token }}
175202
run: ./scripts/render-docs-for-github-actions.sh
176203

177204
- name: Upload GitHub Actions Docs

0 commit comments

Comments
 (0)