Skip to content

Commit bc8a746

Browse files
marcinaknysh
andauthored
Add github actions for precommit and lint (#3)
* Add github actions for precommit and lint * Add readme changes * Manually fix readme * Manually fix readme * Update buildharness github action release * Update readme * Update .github/workflows/lint.yml Co-authored-by: Andriy Knysh <[email protected]> Co-authored-by: Andriy Knysh <[email protected]>
1 parent 6faeb7e commit bc8a746

5 files changed

Lines changed: 99 additions & 59 deletions

File tree

.github/workflows/lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
11+
jobs:
12+
lint-readme:
13+
name: readme
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: cloudposse/[email protected]
18+
with:
19+
entrypoint: /usr/bin/make
20+
args: readme/lint
21+
22+
super-linter:
23+
name: superlinter
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v2
28+
- name: Lint Code Base
29+
uses: docker://github/super-linter:v3
30+
env:
31+
VALIDATE_ALL_CODEBASE: false

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: cloudposse-terraform-workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- uses: actions/setup-python@v1
14+
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- repo: git://github.com/antonbabenko/pre-commit-terraform
7+
rev: v1.31.0
8+
hooks:
9+
- id: terraform_fmt

README.md

Lines changed: 42 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
<!--
2-
3-
4-
5-
6-
7-
8-
1+
# terraform-example-module [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-example-module.svg)](https://github.com/cloudposse/terraform-example-module/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) [![Discourse Forum](https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg)](https://ask.sweetops.com/)
92

3+
[![README Header][readme_header_img]][readme_header_link]
104

5+
[![Cloud Posse][logo]](https://cpco.io/homepage)
116

7+
<!--
128
139
1410
1511
1612
** DO NOT EDIT THIS FILE
17-
**
18-
** This file was automatically generated by the `build-harness`.
19-
** 1) Make all changes to `README.yaml`
13+
**
14+
** This file was automatically generated by the `build-harness`.
15+
** 1) Make all changes to `README.yaml`
2016
** 2) Run `make init` (you only need to do this once)
21-
** 3) Run`make readme` to rebuild this file.
17+
** 3) Run`make readme` to rebuild this file.
2218
**
2319
** (We maintain HUNDREDS of open source projects. This is how we maintain our sanity.)
2420
**
@@ -27,31 +23,15 @@
2723
2824
2925
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
-->
41-
[![README Header][readme_header_img]][readme_header_link]
42-
43-
[![Cloud Posse][logo]](https://cpco.io/homepage)
44-
45-
# terraform-example-module [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-example-module.svg)](https://github.com/cloudposse/terraform-example-module/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) [![Discourse Forum](https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg)](https://ask.sweetops.com/)
46-
26+
-->
4727

4828
This is `terraform-example-module` project provides all the scaffolding for a typical well-built Cloud Posse module. It's a template repository you can
4929
use when creating new repositories.
5030

5131

5232
---
5333

54-
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
34+
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
5535
[<img align="right" title="Share via Email" src="https://docs.cloudposse.com/images/ionicons/ios-email-outline-2.0.1-16x16-999999.svg"/>][share_email]
5636
[<img align="right" title="Share on Google+" src="https://docs.cloudposse.com/images/ionicons/social-googleplus-outline-2.0.1-16x16-999999.svg" />][share_googleplus]
5737
[<img align="right" title="Share on Facebook" src="https://docs.cloudposse.com/images/ionicons/social-facebook-outline-2.0.1-16x16-999999.svg" />][share_facebook]
@@ -72,7 +52,7 @@ It's 100% Open Source and licensed under the [APACHE2](LICENSE).
7252

7353

7454

75-
We literally have [*hundreds of terraform modules*][terraform_modules] that are Open Source and well-maintained. Check them out!
55+
We literally have [*hundreds of terraform modules*][terraform_modules] that are Open Source and well-maintained. Check them out!
7656

7757

7858

@@ -106,8 +86,9 @@ Here is an example of using this module:
10686

10787

10888

89+
<!-- markdownlint-disable -->
10990
## Makefile Targets
110-
```
91+
```text
11192
Available targets:
11293
11394
help Help screen
@@ -116,6 +97,7 @@ Available targets:
11697
lint Lint terraform code
11798
11899
```
100+
<!-- markdownlint-restore -->
119101
## Requirements
120102

121103
| Name | Version |
@@ -145,9 +127,9 @@ Available targets:
145127

146128

147129

148-
## Share the Love
130+
## Share the Love
149131

150-
Like this project? Please give it a ★ on [our GitHub](https://github.com/cloudposse/terraform-example-module)! (it helps us **a lot**)
132+
Like this project? Please give it a ★ on [our GitHub](https://github.com/cloudposse/terraform-example-module)! (it helps us **a lot**)
151133

152134
Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =)
153135

@@ -163,7 +145,7 @@ Check out these related projects.
163145

164146
## References
165147

166-
For additional context, refer to some of these links.
148+
For additional context, refer to some of these links.
167149

168150
- [Terraform Standard Module Structure](https://www.terraform.io/docs/modules/index.html#standard-module-structure) - HashiCorp's standard module structure is a file and directory layout we recommend for reusable modules distributed in separate repositories.
169151
- [Terraform Module Requirements](https://www.terraform.io/docs/registry/modules/publish.html#requirements) - HashiCorp's guidance on all the requirements for publishing a module. Meeting the requirements for publishing a module is extremely easy.
@@ -173,7 +155,7 @@ For additional context, refer to some of these links.
173155

174156
## Help
175157

176-
**Got a question?** We got answers.
158+
**Got a question?** We got answers.
177159

178160
File a GitHub [issue](https://github.com/cloudposse/terraform-example-module/issues), send us an [email][email] or join our [Slack Community][slack].
179161

@@ -182,7 +164,7 @@ File a GitHub [issue](https://github.com/cloudposse/terraform-example-module/iss
182164
## DevOps Accelerator for Startups
183165

184166

185-
We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us.
167+
We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us.
186168

187169
[![Learn More](https://img.shields.io/badge/learn%20more-success.svg?style=for-the-badge)][commercial_support]
188170

@@ -211,11 +193,11 @@ Participate in our [Discourse Forums][discourse]. Here you'll find answers to co
211193

212194
## Newsletter
213195

214-
Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
196+
Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
215197

216198
## Office Hours
217199

218-
[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
200+
[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
219201

220202
[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours]
221203

@@ -249,28 +231,30 @@ Copyright © 2020-2020 [Cloud Posse, LLC](https://cloudposse.com)
249231

250232

251233

252-
## License
234+
## License
253235

254-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
236+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
255237

256238
See [LICENSE](LICENSE) for full details.
257239

258-
Licensed to the Apache Software Foundation (ASF) under one
259-
or more contributor license agreements. See the NOTICE file
260-
distributed with this work for additional information
261-
regarding copyright ownership. The ASF licenses this file
262-
to you under the Apache License, Version 2.0 (the
263-
"License"); you may not use this file except in compliance
264-
with the License. You may obtain a copy of the License at
265-
266-
https://www.apache.org/licenses/LICENSE-2.0
267-
268-
Unless required by applicable law or agreed to in writing,
269-
software distributed under the License is distributed on an
270-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
271-
KIND, either express or implied. See the License for the
272-
specific language governing permissions and limitations
273-
under the License.
240+
```text
241+
Licensed to the Apache Software Foundation (ASF) under one
242+
or more contributor license agreements. See the NOTICE file
243+
distributed with this work for additional information
244+
regarding copyright ownership. The ASF licenses this file
245+
to you under the Apache License, Version 2.0 (the
246+
"License"); you may not use this file except in compliance
247+
with the License. You may obtain a copy of the License at
248+
249+
https://www.apache.org/licenses/LICENSE-2.0
250+
251+
Unless required by applicable law or agreed to in writing,
252+
software distributed under the License is distributed on an
253+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
254+
KIND, either express or implied. See the License for the
255+
specific language governing permissions and limitations
256+
under the License.
257+
```
274258

275259

276260

@@ -292,7 +276,7 @@ This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? P
292276

293277
We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We ❤️ [Open Source Software][we_love_open_source].
294278

295-
We offer [paid support][commercial_support] on all of our projects.
279+
We offer [paid support][commercial_support] on all of our projects.
296280

297281
Check out [our other projects][github], [follow us on twitter][twitter], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.
298282

docs/targets.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
<!-- markdownlint-disable -->
12
## Makefile Targets
2-
```
3+
```text
34
Available targets:
45
56
help Help screen
@@ -8,3 +9,4 @@ Available targets:
89
lint Lint terraform code
910
1011
```
12+
<!-- markdownlint-restore -->

0 commit comments

Comments
 (0)