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

Commit 13b1894

Browse files
chore: avoid update-docs workflow runs on pushes to main (#3617)
Docs should be updated on branches, in case of the locked main branch a PR is created. This to ensure the main is up-to-date. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 941682e commit 13b1894

File tree

5 files changed

+12
-25
lines changed

5 files changed

+12
-25
lines changed

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

+8-21
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,25 @@ jobs:
1616
name: Auto update terraform docs
1717
runs-on: ubuntu-latest
1818
steps:
19-
- name: Get installation token
20-
uses: philips-software/app-token-action@a37926571e4cec6f219e06727136efdd073d8657 # ratchet:philips-software/[email protected]
21-
id: token
22-
with:
23-
app_id: ${{ secrets.FOREST_RELEASER_APP_ID }}
24-
app_base64_private_key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
25-
auth_type: installation
26-
27-
# We use the app for branches in this this repo to ensure PR chekcs are kept in place.
28-
- if: github.event_name == 'push' && github.repository_owner == 'philips-labs' && github.ref != 'refs/heads/main'
29-
name: Checkout with App Token
30-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
31-
with:
32-
token: ${{ steps.token.outputs.token }}
33-
34-
- if: (github.event_name == 'push' && github.repository_owner != 'philips-labs') || github.ref == 'refs/heads/main'
35-
name: Checkout with GITHUB Action token
19+
- name: Checkout with GITHUB Action token
3620
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
3721

3822
- name: Generate TF docs
3923
uses: terraform-docs/gh-actions@f6d59f89a280fa0a3febf55ef68f146784b20ba0 # ratchet:terraform-docs/[email protected]
4024
with:
4125
find-dir: .
4226
git-commit-message: "docs: auto update terraform docs"
43-
git-push: ${{ github.ref != 'refs/heads/main' }}
27+
git-push: ${{ github.ref != 'refs/heads/main' || github.repository_owner != 'philips-labs' }}
4428

29+
# change docs via PR in case of locked main branch
4530
- name: Create Pull Request (main branch only)
46-
if: github.ref == 'refs/heads/main'
31+
if: github.ref == 'refs/heads/main' && github.repository_owner == 'philips-labs'
4732
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # ratchet:peter-evans/[email protected]
4833
with:
49-
token: ${{ steps.token.outputs.token || secrets.GITHUB_TOKEN }}
34+
token: ${{ secrets.GITHUB_TOKEN }}
5035
commit-message: "Update Terraform docs"
5136
title: "docs: Update Terraform docs"
52-
branch: ${{ github.event.pull_request.base.ref }}-update-docs
37+
branch: update-docs
38+
branch-suffix: random
5339
base: ${{ github.event.pull_request.base.ref }}
40+
delete-branch: true

Diff for: examples/arm64/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Be aware some shells will print some end of line character `%`.
6464

6565
| Name | Description | Type | Default | Required |
6666
|------|-------------|------|---------|:--------:|
67-
| <a name="input_github_app"></a> [github\_app](#input\_github\_app) | GitHub for API usages. | <pre>object({<br> id = string<br> key_base64 = string<br> })</pre> | n/a | yes |
67+
| <a name="input_github_app"></a> [github\_app](#input\_github\_app) | GitHub App for API usages. | <pre>object({<br> id = string<br> key_base64 = string<br> })</pre> | n/a | yes |
6868

6969
## Outputs
7070

Diff for: examples/arm64/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variable "github_app" {
2-
description = "GitHub for API usages."
2+
description = "GitHub App for API usages."
33

44
type = object({
55
id = string

Diff for: examples/default/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ terraform output webhook_secret
6262

6363
| Name | Description | Type | Default | Required |
6464
|------|-------------|------|---------|:--------:|
65-
| <a name="input_environment"></a> [environment](#input\_environment) | Environment name, used as prefix | `string` | `null` | no |
65+
| <a name="input_environment"></a> [environment](#input\_environment) | Environment name, used as prefix. | `string` | `null` | no |
6666
| <a name="input_github_app"></a> [github\_app](#input\_github\_app) | GitHub for API usages. | <pre>object({<br> id = string<br> key_base64 = string<br> })</pre> | n/a | yes |
6767

6868
## Outputs

Diff for: examples/default/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ variable "github_app" {
88
}
99

1010
variable "environment" {
11-
description = "Environment name, used as prefix"
11+
description = "Environment name, used as prefix."
1212

1313
type = string
1414
default = null

0 commit comments

Comments
 (0)