-
Notifications
You must be signed in to change notification settings - Fork 62
58 lines (51 loc) · 1.89 KB
/
update-tfdocs.yml
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
name: update-terraform-docs
run-name: update terraform-docs version
on:
repository_dispatch:
types: [trigger-workflow]
workflow_dispatch:
inputs:
release-version:
description: "terraform-docs new release version"
required: true
type: string
env:
GOMPLATE_VERSION: "v3.8.0"
jobs:
prepare:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.COMMITTER_TOKEN }}
- name: Install gomplate
run: |
sudo curl -sSLo /usr/local/bin/gomplate https://github.com/hairyhenderson/gomplate/releases/download/${{ env.GOMPLATE_VERSION }}/gomplate_linux-amd64
sudo chmod 755 /usr/local/bin/gomplate
- name: Get variables
run: |
if [ -n "${{ github.event.client_payload.release-version }}" ]; then
release_version="${{ github.event.client_payload.release-version }}"
else
release_version="${{ inputs.release-version }}"
fi
echo "release_version=${release_version//v/}" >> "$GITHUB_ENV"
- name: Bump to terraform-docs v${{ env.release_version }}
run: |
./.github/scripts/prepare-release.sh "" ${{ env.release_version }}
- name: Push terraform-docs v${{ env.release_version }} Changes
uses: stefanzweifel/git-auto-commit-action@v5
env:
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
with:
file_pattern: "README.md Dockerfile"
commit_message: "chore: bump terraform-docs to v${{ env.release_version }}"
commit_user_name: terraform-docs-bot
commit_user_email: bot@terraform-docs.io
commit_author: "terraform-docs-bot <bot@terraform-docs.io>"