@@ -16,38 +16,25 @@ jobs:
16
16
name : Auto update terraform docs
17
17
runs-on : ubuntu-latest
18
18
steps :
19
- - name : Get installation token
20
- uses :
philips-software/app-token-action@a37926571e4cec6f219e06727136efdd073d8657 # ratchet:philips-software/[email protected]
21
- id : token
22
- with :
23
- app_id : ${{ secrets.FOREST_RELEASER_APP_ID }}
24
- app_base64_private_key : ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
25
- auth_type : installation
26
-
27
- # We use the app for branches in this this repo to ensure PR chekcs are kept in place.
28
- - if : github.event_name == 'push' && github.repository_owner == 'philips-labs' && github.ref != 'refs/heads/main'
29
- name : Checkout with App Token
30
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
31
- with :
32
- token : ${{ steps.token.outputs.token }}
33
-
34
- - if : (github.event_name == 'push' && github.repository_owner != 'philips-labs') || github.ref == 'refs/heads/main'
35
- name : Checkout with GITHUB Action token
19
+ - name : Checkout with GITHUB Action token
36
20
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
37
21
38
22
- name : Generate TF docs
39
23
uses :
terraform-docs/gh-actions@f6d59f89a280fa0a3febf55ef68f146784b20ba0 # ratchet:terraform-docs/[email protected]
40
24
with :
41
25
find-dir : .
42
26
git-commit-message : " docs: auto update terraform docs"
43
- git-push : ${{ github.ref != 'refs/heads/main' }}
27
+ git-push : ${{ github.ref != 'refs/heads/main' || github.repository_owner != 'philips-labs' }}
44
28
29
+ # change docs via PR in case of locked main branch
45
30
- name : Create Pull Request (main branch only)
46
- if : github.ref == 'refs/heads/main'
31
+ if : github.ref == 'refs/heads/main' && github.repository_owner == 'philips-labs'
47
32
uses :
peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # ratchet:peter-evans/[email protected]
48
33
with :
49
- token : ${{ steps.token.outputs.token || secrets.GITHUB_TOKEN }}
34
+ token : ${{ secrets.GITHUB_TOKEN }}
50
35
commit-message : " Update Terraform docs"
51
36
title : " docs: Update Terraform docs"
52
- branch : ${{ github.event.pull_request.base.ref }}-update-docs
37
+ branch : update-docs
38
+ branch-suffix : random
53
39
base : ${{ github.event.pull_request.base.ref }}
40
+ delete-branch : true
0 commit comments