Skip to content

Commit c65f744

Browse files
committed
Resolve markdownlint warnings for READMEs
1 parent 72986c4 commit c65f744

File tree

64 files changed

+436
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+436
-227
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ These actions can be used to easily perform [Terraform](https://www.terraform.io
88
Currently, there is just experimental support for OpenTofu, see [here](https://github.com/dflook/terraform-github-actions/blob/main/CHANGELOG.md#1370---2023-10-29)
99

1010
## Actions
11+
1112
See the documentation for the available actions:
1213

1314
| Terraform | OpenTofu |
@@ -28,6 +29,7 @@ See the documentation for the available actions:
2829
| [dflook/terraform-test](terraform-test) | [dflook/tofu-test](tofu-test) |
2930

3031
## Example Usage
32+
3133
These actions can be added as steps to your own workflow files.
3234
GitHub reads workflow files from `.github/workflows/` within your repository.
3335
See the [Workflow documentation](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#about-workflows) for details on writing workflows.
@@ -42,15 +44,17 @@ Fortunately, GitHub has a well established method for requiring human reviews of
4244
We can use PRs to safely plan and apply infrastructure changes.
4345

4446
<p align="center">
45-
<img src="terraform-apply/planapply.gif" width="1000">
47+
<img src="terraform-apply/planapply.gif" width="960" alt="A video showing a PR being created, a plan being generated, the plan being reviewed, and the plan being applied.">
4648
</p>
4749

4850
You can make GitHub enforce this using branch protection, see the [dflook/terraform-apply](terraform-apply) action for details.
4951

5052
In this example we use two workflows:
5153

5254
#### plan.yaml
55+
5356
This workflow runs on changes to a PR branch. It generates a Terraform plan and attaches it to the PR as a comment.
57+
5458
```yaml
5559
name: Create terraform plan
5660

@@ -77,7 +81,9 @@ jobs:
7781
```
7882
7983
#### apply.yaml
84+
8085
This workflow runs when the PR is merged into the main branch, and applies the planned changes.
86+
8187
```yaml
8288
name: Apply terraform plan
8389

@@ -107,16 +113,18 @@ jobs:
107113
```
108114
109115
### Linting
116+
110117
This workflow runs on every push to non-main branches and checks the terraform configuration is valid.
111118
For extra strictness, we check the files are in the canonical format.
112119
113120
<p align="center">
114-
<img src="terraform-validate/validate.png" width="1000">
121+
<img src="terraform-validate/validate.png" width="1000" alt="A screenshot showing the output of the terraform validate action.">
115122
</p>
116123
117124
This can be used to check for correctness before merging.
118125
119126
#### lint.yaml
127+
120128
```yaml
121129
name: Lint
122130

@@ -159,6 +167,7 @@ This can be used to detect manual or misapplied changes before they become a pro
159167
If there are any unexpected changes, the workflow will fail.
160168
161169
#### drift.yaml
170+
162171
```yaml
163172
name: Check for infrastructure drift
164173

@@ -181,12 +190,14 @@ jobs:
181190
```
182191
183192
### Scheduled infrastructure updates
193+
184194
There may be times when you expect Terraform to plan updates without any changes to your configuration files.
185195
Your configuration could be consuming secrets from elsewhere, or renewing certificates every few months.
186196
187197
This example workflow runs every morning and applies any outstanding changes to those specific resources.
188198
189199
#### rotate-certs.yaml
200+
190201
```yaml
191202
name: Rotate TLS certificates
192203

@@ -213,9 +224,11 @@ jobs:
213224
```
214225
215226
### Automatically fixing formatting
227+
216228
Perhaps you don't want to spend engineer time making formatting changes. This workflow will automatically create or update a PR that fixes any formatting issues.
217229
218230
#### fmt.yaml
231+
219232
```yaml
220233
name: Check terraform file formatting
221234

@@ -247,12 +260,14 @@ jobs:
247260
```
248261
249262
### Ephemeral test environments
263+
250264
Testing of software changes often requires some supporting infrastructure, like databases, DNS records, compute environments etc.
251265
We can use these actions to create dedicated resources for each PR which is used to run tests.
252266
253267
There are two workflows:
254268
255269
#### integration-test.yaml
270+
256271
This workflow runs with every change to a PR.
257272
258273
It deploys the testing infrastructure using a Terraform workspace dedicated to this branch, then runs integration tests against the new infrastructure.
@@ -290,7 +305,9 @@ jobs:
290305
```
291306
292307
#### integration-test-cleanup.yaml
308+
293309
This workflow runs when a PR is closed and destroys any testing infrastructure that is no longer needed.
310+
294311
```yaml
295312
name: Destroy testing workspace
296313

docs-gen/actions/apply.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@
4141
You can instead set `auto_approve: true` which will generate a plan and apply it immediately, without looking for a plan attached to a PR.
4242
4343
## Demo
44-
This a demo of the process for apply a $ProductName change using the [`dflook/$ToolName-plan`](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-plan) and [`dflook/$ToolName-apply`](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-apply) actions.
44+
45+
This a demo of the process for apply a $ProductName change using the [`dflook/$ToolName-plan`](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-plan)
46+
and [`dflook/$ToolName-apply`](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-apply) actions.
4547
4648
<p align="center">
47-
<img src="planapply.gif" width="1000">
49+
<img src="planapply.gif" width="1000" alt="An example of the plan and apply actions">
4850
</p>
4951
5052
## GitHub
@@ -93,7 +95,7 @@
9395
9496
- `apply-failed` - The Terraform apply operation failed.
9597
- `plan-changed` - The approved plan is no longer accurate, so the apply will not be attempted.
96-
- `state-locked` - The Terraform state lock could not be obtained because it was already locked.
98+
- `state-locked` - The Terraform state lock could not be obtained because it was already locked.
9799
98100
If the job fails for any other reason this will not be set.
99101
This can be used with the Actions expression syntax to conditionally run steps.
@@ -105,7 +107,7 @@
105107
],
106108
environment_variables=[
107109
dataclasses.replace(GITHUB_TOKEN, description='''
108-
The GitHub authorization token to use to fetch an approved plan from a PR.
110+
The GitHub authorization token to use to fetch an approved plan from a PR.
109111
This must belong to the same user/app as the token used by the [$ToolName-plan](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-plan) action.
110112
''' + GITHUB_TOKEN.description),
111113
TERRAFORM_ACTIONS_GITHUB_TOKEN,
@@ -120,13 +122,13 @@
120122
121123
When applying a plan from a PR comment (`auto_approve` is the default of `false`), the workflow can be triggered by the following events:
122124
123-
- pull_request
124-
- pull_request_review_comment
125-
- pull_request_target
126-
- pull_request_review
127-
- issue_comment, if the comment is on a PR (see below)
128-
- push, if the pushed commit came from a PR (see below)
129-
- repository_dispatch, if the client payload includes the pull_request url (see below)
125+
* pull_request
126+
* pull_request_review_comment
127+
* pull_request_target
128+
* pull_request_review
129+
* issue_comment, if the comment is on a PR (see below)
130+
* push, if the pushed commit came from a PR (see below)
131+
* repository_dispatch, if the client payload includes the pull_request url (see below)
130132
131133
When `auto_approve` is set to `true`, the workflow can be triggered by any event.
132134
@@ -165,6 +167,7 @@
165167
This event can be used to trigger a workflow from another workflow. The client payload must include the pull_request api url of where the plan PR comment can be found.
166168
167169
A minimal example payload looks like:
170+
168171
```json
169172
{
170173
"pull_request": {

docs-gen/actions/destroy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'''
2323
:warning: This action uses the `$ToolName destroy` command to immediately destroy all resources in a $ProductName workspace.
2424
25-
To generate a plan that can be reviewed you can instead use the [dflook/$ToolName-plan](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-plan)
25+
To generate a plan that can be reviewed you can instead use the [dflook/$ToolName-plan](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-plan)
2626
and [dflook/$ToolName-apply](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-plan) actions with the `destroy` input set to `true`.
2727
''',
2828
meta_description='Destroys all resources in a $ProductName workspace',
@@ -41,7 +41,7 @@
4141
When the job outcome is `failure`, this output may be set. The value may be one of:
4242
4343
- `destroy-failed` - The $ProductName destroy operation failed.
44-
- `state-locked` - The $ProductName state lock could not be obtained because it was already locked.
44+
- `state-locked` - The $ProductName state lock could not be obtained because it was already locked.
4545
4646
If the job fails for any other reason this will not be set.
4747
This can be used with the Actions expression syntax to conditionally run a steps.

docs-gen/actions/destroy_workspace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
When the job outcome is `failure`, this output may be set. The value may be one of:
4040
4141
- `destroy-failed` - The $ProductName destroy operation failed.
42-
- `state-locked` - The $ProductName state lock could not be obtained because it was already locked.
42+
- `state-locked` - The $ProductName state lock could not be obtained because it was already locked.
4343
4444
If the job fails for any other reason this will not be set.
4545
This can be used with the Actions expression syntax to conditionally run a steps.

docs-gen/actions/fmt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
inputs=[
1818
dataclasses.replace(path, description='The path containing $ProductName files to format.'),
1919
dataclasses.replace(workspace, description='''
20-
$ProductName workspace to inspect when discovering the $ProductName version to use, if the version is not otherwise specified.
20+
$ProductName workspace to inspect when discovering the $ProductName version to use, if the version is not otherwise specified.
2121
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
2222
'''),
2323
dataclasses.replace(backend_config, description='''
24-
List of $ProductName backend config values, one per line. This is used for discovering the $ProductName version to use, if the version is not otherwise specified.
24+
List of $ProductName backend config values, one per line. This is used for discovering the $ProductName version to use, if the version is not otherwise specified.
2525
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
2626
'''),
2727
dataclasses.replace(backend_config_file, description='''
28-
List of $ProductName backend config files to use, one per line. This is used for discovering the $ProductName version to use, if the version is not otherwise specified.
28+
List of $ProductName backend config files to use, one per line. This is used for discovering the $ProductName version to use, if the version is not otherwise specified.
2929
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
3030
Paths should be relative to the GitHub Actions workspace
3131
''')

docs-gen/actions/fmt_check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
inputs=[
2222
dataclasses.replace(path, description='The path containing $ProductName files to check the formatting of.'),
2323
dataclasses.replace(workspace, description='''
24-
$ProductName workspace to inspect when discovering the $ProductName version to use, if the version is not otherwise specified.
24+
$ProductName workspace to inspect when discovering the $ProductName version to use, if the version is not otherwise specified.
2525
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
2626
'''),
2727
dataclasses.replace(backend_config, description='''
28-
List of $ProductName backend config values, one per line. This is used for discovering the $ProductName version to use, if the version is not otherwise specified.
28+
List of $ProductName backend config values, one per line. This is used for discovering the $ProductName version to use, if the version is not otherwise specified.
2929
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
3030
'''),
3131
dataclasses.replace(backend_config_file, description='''
32-
List of $ProductName backend config files to use, one per line. This is used for discovering the $ProductName version to use, if the version is not otherwise specified.
32+
List of $ProductName backend config files to use, one per line. This is used for discovering the $ProductName version to use, if the version is not otherwise specified.
3333
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
3434
Paths should be relative to the GitHub Actions workspace
3535
''')

docs-gen/actions/output.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
This example gets information from object and array(object) outputs.
6767
6868
With this $ProductName config:
69+
6970
```hcl
7071
output "vpc" {
7172
value = aws_vpc.test
@@ -76,6 +77,7 @@
7677
```
7778
7879
We can use the workflow:
80+
7981
```yaml
8082
jobs:
8183
output_example:
@@ -98,7 +100,8 @@
98100
```
99101
100102
Which will print to the workflow log:
101-
```
103+
104+
```text
102105
The vpc-id is vpc-01463b6b84e1454ce
103106
The subnet-ids are subnet-053008016a2c1768c,subnet-07d4ce437c43eba2f,subnet-0a5f8c3a20023b8c0
104107
```

docs-gen/actions/plan.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
If the triggering event relates to a PR it will add a comment on the PR containing the generated plan.
3737
3838
<p align="center">
39-
<img src="plan.png" width="600">
39+
<img src="plan.png" width="600" alt="An example of a PR comment created by the action">
4040
</p>
4141
4242
The `GITHUB_TOKEN` environment variable must be set for the PR comment to be added.
@@ -87,13 +87,13 @@
8787
8888
When adding the plan to a PR comment (`add_github_comment` is not `false`), the workflow can be triggered by the following events:
8989
90-
- pull_request
91-
- pull_request_review_comment
92-
- pull_request_target
93-
- pull_request_review
94-
- issue_comment, if the comment is on a PR (see below)
95-
- push, if the pushed commit came from a PR (see below)
96-
- repository_dispatch, if the client payload includes the pull_request url (see below)
90+
* pull_request
91+
* pull_request_review_comment
92+
* pull_request_target
93+
* pull_request_review
94+
* issue_comment, if the comment is on a PR (see below)
95+
* push, if the pushed commit came from a PR (see below)
96+
* repository_dispatch, if the client payload includes the pull_request url (see below)
9797
9898
When `add_github_comment` is set to `false`, the workflow can be triggered by any event.
9999
@@ -132,6 +132,7 @@
132132
This event can be used to trigger a workflow from another workflow. The client payload must include the pull_request api url of where the plan PR comment should be added.
133133
134134
A minimal example payload looks like:
135+
135136
```json
136137
{
137138
"pull_request": {
@@ -175,10 +176,11 @@
175176
### A full example of inputs
176177
177178
This example workflow demonstrates most of the available inputs:
178-
- The environment variables are set at the workflow level.
179-
- The PR comment will be labelled `production`, and the plan will use the `prod` workspace.
180-
- Variables are read from `env/prod.tfvars`, with `turbo_mode` overridden to `true`.
181-
- The backend config is taken from `env/prod.backend`, and the token is set from a secret.
179+
180+
* The environment variables are set at the workflow level.
181+
* The PR comment will be labelled `production`, and the plan will use the `prod` workspace.
182+
* Variables are read from `env/prod.tfvars`, with `turbo_mode` overridden to `true`.
183+
* The backend config is taken from `env/prod.backend`, and the token is set from a secret.
182184
183185
```yaml
184186
name: PR Plan

docs-gen/actions/validate.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from outputs.failure_reason import failure_reason
1414

1515
backend_reason = '''
16-
This is used for discovering the $ProductName version to use, if not otherwise specified.
16+
This is used for discovering the $ProductName version to use, if not otherwise specified.
1717
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
1818
'''.strip()
1919

@@ -26,7 +26,7 @@
2626
Failing GitHub checks will be added for any problems found.
2727
2828
<p align="center">
29-
<img src="validate.png" width="1000">
29+
<img src="validate.png" width="1000" alt="An example of a failed validation check">
3030
</p>
3131
3232
If the $ProductName configuration is not valid, the build is failed.
@@ -37,8 +37,8 @@
3737
dataclasses.replace(workspace, description='''
3838
$ProductName workspace to use for the `terraform.workspace` value while validating. Note that for remote operations in a cloud backend, this is always `default`.
3939
40-
Also used for discovering the $ProductName version to use, if not otherwise specified.
41-
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
40+
Also used for discovering the $ProductName version to use, if not otherwise specified.
41+
See [dflook/$ToolName-version](https://github.com/dflook/terraform-github-actions/tree/main/$ToolName-version#$ToolName-version-action) for details.
4242
'''),
4343
dataclasses.replace(backend_config, description=backend_config.description + backend_reason),
4444
dataclasses.replace(backend_config_file, description=backend_config_file.description + backend_reason),

0 commit comments

Comments
 (0)