Skip to content

Commit ea6bf5d

Browse files
authored
Update and rename docs.yaml to pull_request.yaml
1 parent 6a09ef6 commit ea6bf5d

File tree

2 files changed

+69
-32
lines changed

2 files changed

+69
-32
lines changed

.github/workflows/docs.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/pull_request.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Validate Docs and Go Code"
2+
on: pull_request
3+
4+
jobs:
5+
tfplugindocs:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout repo
9+
uses: actions/checkout@v3
10+
with:
11+
token: ${{ secrets.GITHUB_TOKEN }}
12+
- name: Generate Docs
13+
run: |
14+
export PATH=$PATH:/home/runner/go/bin
15+
make docs-prepare
16+
tfplugindocs generate
17+
- id: docs-need-updating
18+
name: Validate No Changes
19+
run: |
20+
git diff --exit-code
21+
- name: Issue Comment on PR
22+
if: steps.docs-need-updating.output.outcome != 'success'
23+
uses: thollander/[email protected]
24+
with:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
message: |
27+
:warning: Terraform Provider Docs need updating!
28+
29+
Run:
30+
31+
```bash
32+
$ make docs
33+
```
34+
35+
Then commit the changes.
36+
pr_number: ${{ github.event.pull_request.number }}
37+
comment_tag: docs-need-updating
38+
39+
gofmt:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout repo
43+
uses: actions/checkout@v3
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
- name: Run gofmt
47+
run: |
48+
go fmt
49+
- id: go-needs-formatting
50+
name: Validate No Changes
51+
run: |
52+
git diff --exit-code
53+
- name: Issue Comment on PR
54+
if: steps.go-needs-formatting.output.outcome != 'success'
55+
uses: thollander/[email protected]
56+
with:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
message: |
59+
:warning: Go code needs formatting!
60+
61+
Run:
62+
63+
```bash
64+
$ make fmt
65+
```
66+
67+
Then commit the changes.
68+
pr_number: ${{ github.event.pull_request.number }}
69+
comment_tag: go-needs-formatting

0 commit comments

Comments
 (0)