Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 2943c42

Browse files
npalmgithub-actions[bot]GuptaNavdeep1983
authored
chore(ci): fix tf-docs on PR (#3144)
* chore(ci) - fix tf-docs on PR * test * docs: auto update terraform docs * enable wokflow on main branch * review suggestion Co-authored-by: GuptaNavdeep1983 <[email protected]> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: GuptaNavdeep1983 <[email protected]>
1 parent 670041b commit 2943c42

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

Diff for: .github/workflows/update-docs.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Update docs
22
on:
33
push:
4-
branches:
5-
- release-please--branches--main
6-
pull_request:
7-
4+
paths:
5+
- "*.tf"
6+
- "*.md"
7+
- ".github/workflows/update-docs.yml"
88
permissions: read-all
99
jobs:
1010
docs:
@@ -14,12 +14,6 @@ jobs:
1414
permissions:
1515
contents: write
1616
steps:
17-
- if: github.event_name == 'pull_request'
18-
name: Checkout PR
19-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3
20-
with:
21-
ref: ${{ github.event.pull_request.head.ref }}
22-
2317
- if: github.event_name == 'push'
2418
name: Checkout branch
2519
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3
@@ -29,4 +23,14 @@ jobs:
2923
with:
3024
find-dir: .
3125
git-commit-message: "docs: auto update terraform docs"
32-
git-push: true
26+
git-push: ${{ github.ref != 'refs/heads/main' }}
27+
28+
- name: Create Pull Request (main branch only)
29+
if: github.ref == 'refs/heads/main'
30+
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # ratchet:peter-evans/[email protected]
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
commit-message: "Update Terraform docs"
34+
title: "docs: Update Terraform docs"
35+
branch: ${{ github.event.pull_request.base.ref }}-update-docs
36+
base: ${{ github.event.pull_request.base.ref }}

Diff for: CONTRIBUTING.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ If your issue appears to be a bug, and hasn't been reported, open a new issue. H
5151

5252
**If you get help, help others. Good karma rulez!**
5353

54-
### Submitting a Merge Request
54+
### Submitting a Pull Request
5555

56-
Before you submit your merge request consider the following guidelines:
56+
Before you submit your pull request consider the following guidelines:
5757

5858
* Make your changes in a new git branch:
5959

@@ -62,8 +62,9 @@ Before you submit your merge request consider the following guidelines:
6262
```
6363

6464
* Create your patch, **including appropriate test cases**.
65-
* Install [Terraform](https://www.terraform.io/). We lock the version with [tvenv](https://github.com/tfutils/tfenv), check `required_version` in `versions.tf` for the current development version of the module.
66-
* Install [pre-commit hooks](https://pre-commit.com/). The hooks runs some basic checks and update the docs. The commit will run the hooks, you can invoke the hooks manually `pre-commit run --all-files` as well.
65+
* Install [Terraform](https://www.terraform.io/). We lock the version with [tfenv](https://github.com/tfutils/tfenv), check `required_version` in `versions.tf` for the current development version of the module.
66+
* Install [pre-commit hooks](https://pre-commit.com/). The hooks runs some basic checks. The commit will run the hooks, you can invoke the hooks manually `pre-commit run --all-files` as well.
67+
* For updating docs, you have to enable GitHub actions on your forked repository. Simply go to the tab Actions and enable actions.
6768
* Commit your changes using a descriptive commit message.
6869

6970
```shell

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ This [Terraform](https://www.terraform.io/) module creates the required infrastr
3636
- [Logging](#logging)
3737
- [Debugging](#debugging)
3838
- [Security Consideration](#security-consideration)
39+
- [Requirements](#requirements)
40+
- [Providers](#providers)
41+
- [Modules](#modules)
42+
- [Resources](#resources)
43+
- [Inputs](#inputs)
44+
- [Outputs](#outputs)
3945
- [Contribution](#contribution)
4046
- [Philips Forest](#philips-forest)
4147

0 commit comments

Comments
 (0)