forked from terraform-docs/gh-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.55 KB
/
test.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
name: validate
on:
workflow_dispatch:
push:
branches:
- main
- release-*
pull_request:
jobs:
shellcheck:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: "."
readme:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install gomplate
run: |
sudo curl -o /usr/local/bin/gomplate -sSL https://github.com/hairyhenderson/gomplate/releases/download/v3.8.0/gomplate_linux-amd64
sudo chmod 755 /usr/local/bin/gomplate
- name: Check README content based on action.yml
if: ${{ github.repository_owner == 'terraform-docs' }}
run: |
./scripts/update-readme.sh
if [ $(git status --porcelain | grep -c 'M README.md') -eq 1 ]; then
git diff
exit 1
fi
- name: Check README content based on action.yml
if: ${{ github.repository_owner != 'terraform-docs' }}
run: |
./scripts/update-readme.sh
if [ $(git status --porcelain | grep -c 'M README.md') -eq 1 ]; then
git config user.email "noreply.${{ github.actor }}@github.com"
git config user.name "${{ github.actor }}"
git commit -m "docs: README.md Updated"
git push
fi