-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (36 loc) · 1.14 KB
/
docs.yml
File metadata and controls
43 lines (36 loc) · 1.14 KB
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
name: Terraform
on:
push:
branches:
- main
jobs:
docs:
name: docs
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
name: Checkout source code
- name: Render terraform docs inside the README.md and push changes back to main branch
uses: terraform-docs/gh-actions@v1.3.0
# fix to terraform-docs action change ownership of files
- name: Update ownership of files
run: |
sudo chown $(id -u):$(id -g) -R .git/
- name: Check for available updates
id: check-existence
run: |
echo "::set-output name=branches::$(git ls-remote --heads origin generated-docs-\* | tr -d '\n')"
- name: Create Pull Request
if: steps.check-existence.outputs.branches == ''
uses: peter-evans/create-pull-request@v7
with:
title: Update terraform docs
branch: generated-docs
branch-suffix: short-commit-hash
delete-branch: true
commit-message: "docs: autogenerated docs"
add-paths: |
**/README.md