Skip to content

Commit dcb854f

Browse files
authored
feat: add new GH actions (#5)
1 parent ed29804 commit dcb854f

15 files changed

+411
-150
lines changed

.github/auto-release.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: '$RESOLVED_VERSION'
3+
version-template: '$MAJOR.$MINOR.$PATCH'
4+
version-resolver:
5+
major:
6+
labels:
7+
- 'major'
8+
minor:
9+
labels:
10+
- 'minor'
11+
- 'enhancement'
12+
- 'feat'
13+
patch:
14+
labels:
15+
- 'auto-update'
16+
- 'patch'
17+
- 'fix'
18+
- 'bugfix'
19+
- 'bug'
20+
- 'hotfix'
21+
- 'refactor'
22+
- 'ci'
23+
- 'build'
24+
- 'docs'
25+
- 'test'
26+
- 'chore'
27+
default: 'minor'
28+
29+
categories:
30+
- title: '🚀 Enhancements'
31+
labels:
32+
- 'enhancement'
33+
- 'patch'
34+
- title: '🐛 Bug Fixes'
35+
labels:
36+
- 'fix'
37+
- 'bugfix'
38+
- 'bug'
39+
- 'hotfix'
40+
- title: '🤖 Automatic Updates'
41+
labels:
42+
- 'auto-update'
43+
44+
change-template: |
45+
<details>
46+
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
47+
$BODY
48+
</details>
49+
template: |
50+
$CHANGES

.github/labeler.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: v1
2+
3+
labels:
4+
- label: "feat"
5+
matcher:
6+
title: "^feat:.*"
7+
- label: "ci"
8+
matcher:
9+
title: "^ci:.*"
10+
- label: "chore"
11+
matcher:
12+
title: "^chore:.*"
13+
- label: "build"
14+
matcher:
15+
title: "^build:.*"
16+
- label: "docs"
17+
matcher:
18+
title: "^docs:.*"
19+
- label: "refactor"
20+
matcher:
21+
title: "^refactor:.*"
22+
- label: "test"
23+
matcher:
24+
title: "^test:.*"

.github/labels.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
# Default GitHub labels
3+
- color: d73a4a
4+
name: bug
5+
description: Something isn't working
6+
- color: cfd3d7
7+
name: duplicate
8+
description: This issue or pull request already exists
9+
- color: a2eeef
10+
name: enhancement
11+
description: New feature or request
12+
- color: 7057ff
13+
name: good first issue
14+
description: Good for newcomers
15+
- color: 008672
16+
name: help wanted
17+
description: Extra attention is needed
18+
- color: e4e669
19+
name: invalid
20+
description: This doesn't seem right
21+
- color: d876e3
22+
name: question
23+
description: Further information is requested
24+
- color: ffffff
25+
name: wontfix
26+
description: This will not be worked on
27+
28+
- color: a0040c
29+
name: no-pr-activity
30+
description: stalled PR
31+
- color: d93f0b
32+
name: no-issue-activity
33+
description: stalled issue
34+
- color: f9dcbd
35+
name: build
36+
description: Changes that affect the build system or external dependencies
37+
- color: 63dae2
38+
name: ci
39+
description: Changes to our CI configuration files and scripts
40+
- color: 6e93e5
41+
name: docs
42+
description: Documentation only changes
43+
- color: 5edb3f
44+
name: feat
45+
description: A new feature
46+
- color: 58e8c8
47+
name: fix
48+
description: A bug fix
49+
- color: efada0
50+
name: refactor
51+
description: A code change that neither fixes a bug nor adds a feature
52+
- color: 1d76db
53+
name: test
54+
description: Adding missing tests or correcting existing tests
55+
- color: dfb443
56+
name: chore
57+
description: Adding missing tests or correcting existing tests

.github/workflows/docs.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Generate terraform docs
22
on:
3-
- pull_request
3+
pull_request_target:
4+
pull_request:
5+
46
jobs:
57
docs:
68
runs-on: ubuntu-latest

.github/workflows/labeler.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Auto Label
2+
on:
3+
pull_request_target:
4+
pull_request:
5+
6+
jobs:
7+
labeler:
8+
name: Labeler
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: fuxingloh/[email protected]
12+
with:
13+
github-token: ${{ secrets.GITHUB_TOKEN }}
14+
config-path: .github/labeler.yml

.github/workflows/labels.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Sync labels in the declarative way
3+
on:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/[email protected]
12+
- uses: micnncim/[email protected]
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
GITHUB_REPOSITORY: ${{ github.repository }}
16+
with:
17+
manifest: .github/labels.yml

.github/workflows/pr-lint.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
name: Lint PR
22
on:
3+
pull_request_target:
34
pull_request:
4-
types:
5-
- opened
6-
- reopened
7-
- edited
8-
- synchronize
95

106
jobs:
117
main:
@@ -38,3 +34,4 @@ jobs:
3834
* **refactor**: A code change that neither fixes a bug nor adds a feature
3935
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
4036
* **test**: Adding missing tests or correcting existing tests
37+
* **chore**: No production code change

.github/workflows/release.yml

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
name: Release
1+
2+
name: Release Drafter
3+
24
on:
35
push:
4-
tags:
5-
- "v*"
6+
branches:
7+
- master
8+
69
jobs:
7-
release-notary:
8-
name: Release-notary
10+
publish:
911
runs-on: ubuntu-latest
1012
steps:
11-
- name: Check out code
12-
uses: actions/checkout@v1
13-
14-
- name: Release Notary Action
15-
uses: commitsar-app/[email protected]
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
# Drafts your next Release notes as Pull Requests are merged into "master"
14+
- uses: release-drafter/release-drafter@v5
15+
with:
16+
publish: true
17+
prerelease: false
18+
config-name: auto-release.yml
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Mark stale issues and pull requests
2+
3+
on:
4+
schedule:
5+
- cron: "0 12 * * *"
6+
7+
jobs:
8+
stale:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/stale@v1
14+
with:
15+
repo-token: ${{ secrets.GITHUB_TOKEN }}
16+
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
17+
stale-pr-message: 'This pull-request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
18+
stale-issue-label: 'no-issue-activity'
19+
stale-pr-label: 'no-pr-activity'
20+
days-before-stale: 30
21+
days-before-close: 5

.github/workflows/terraform.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: 'Validate TF manifests'
22
on:
3-
- pull_request
3+
pull_request_target:
4+
pull_request:
5+
46
jobs:
57
terraform:
68
name: Terraform
@@ -12,7 +14,7 @@ jobs:
1214
- name: Terraform
1315
uses: hashicorp/setup-terraform@v1
1416
with:
15-
terraform_version: 0.12.29
17+
terraform_version: 0.14.7
1618

1719
- name: Terraform Format
1820
run: terraform fmt

README.md

+1-29
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,7 @@ module "your_aweasome_resource" {
1515
```
1616

1717
<!--- BEGIN_TF_DOCS --->
18-
## Requirements
19-
20-
| Name | Version |
21-
|------|---------|
22-
| terraform | ~> 0.12.0 |
23-
24-
## Providers
25-
26-
No provider.
27-
28-
## Inputs
29-
30-
| Name | Description | Type | Default | Required |
31-
|------|-------------|------|---------|:--------:|
32-
| name | Solution name, e.g. `app` or `jenkins` | `string` | n/a | yes |
33-
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | n/a | yes |
34-
| stage | Stage, e.g. 'prod', 'staging', 'dev' | `string` | n/a | yes |
35-
| additional\_tag\_map | Additional tags for appending to each tag map | `map(string)` | `{}` | no |
36-
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
37-
| context | Default context to use for passing state between label invocations | <pre>object({<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> enabled = bool<br> delimiter = string<br> attributes = list(string)<br> label_order = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": "",<br> "enabled": true,<br> "environment": "",<br> "label_order": [],<br> "name": "",<br> "namespace": "",<br> "regex_replace_chars": "",<br> "stage": "",<br> "tags": {}<br>}</pre> | no |
38-
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
39-
| enabled | Set to false to prevent the module from creating any resources | `bool` | `true` | no |
40-
| label\_order | The naming order of the id output and Name tag | `list(string)` | `[]` | no |
41-
| regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed | `string` | `"/[^a-zA-Z0-9-]/"` | no |
42-
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no |
43-
44-
## Outputs
45-
46-
No output.
18+
Error: no lines in file
4719

4820
<!--- END_TF_DOCS --->
4921

0 commit comments

Comments
 (0)