Skip to content

Commit 54f327b

Browse files
authored
chore: Update release configuration files to correctly use conventional-commits (terraform-aws-modules#178)
1 parent 5213e17 commit 54f327b

File tree

24 files changed

+108
-23
lines changed

24 files changed

+108
-23
lines changed

.github/workflows/pr-title.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'Validate PR title'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Please look up the latest version from
16+
# https://github.com/amannn/action-semantic-pull-request/releases
17+
- uses: amannn/[email protected]
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
# Configure which types are allowed.
22+
# Default: https://github.com/commitizen/conventional-commit-types
23+
types: |
24+
fix
25+
feat
26+
docs
27+
ci
28+
chore
29+
# Configure that a scope must always be provided.
30+
requireScope: false
31+
# Configure additional validation for the subject based on a regex.
32+
# This example ensures the subject starts with an uppercase character.
33+
subjectPattern: ^[A-Z].+$
34+
# If `subjectPattern` is configured, you can use this property to override
35+
# the default error message that is shown when the pattern doesn't match.
36+
# The variables `subject` and `title` can be used within the message.
37+
subjectPatternError: |
38+
The subject "{subject}" found in the pull request title "{title}"
39+
didn't match the configured pattern. Please ensure that the subject
40+
starts with an uppercase character.
41+
# For work-in-progress PRs you can typically use draft pull requests
42+
# from Github. However, private repositories on the free plan don't have
43+
# this option and therefore this action allows you to opt-in to using the
44+
# special "[WIP]" prefix to indicate this state. This will avoid the
45+
# validation of the PR title and the pull request checks remain pending.
46+
# Note that a second check will be reported if this is enabled.
47+
wip: true
48+
# When using "Squash and merge" on a PR with only one commit, GitHub
49+
# will suggest using that commit message instead of the PR title for the
50+
# merge commit, and it's easy to commit this by mistake. Enable this option
51+
# to also validate the commit message for one commit PRs.
52+
validateSingleCommit: false

.github/workflows/release.yml

+5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ on:
77
- main
88
- master
99
paths:
10+
- '**/*.tpl'
1011
- '**/*.py'
1112
- '**/*.tf'
13+
- '.github/workflows/release.yml'
1214

1315
jobs:
1416
release:
1517
name: Release
1618
runs-on: ubuntu-latest
19+
# Skip running release workflow on forks
20+
if: github.repository_owner == 'terraform-aws-modules'
1721
steps:
1822
- name: Checkout
1923
uses: actions/checkout@v2
@@ -28,5 +32,6 @@ jobs:
2832
extra_plugins: |
2933
@semantic-release/[email protected]
3034
@semantic-release/[email protected]
35+
3136
env:
3237
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}

.github/workflows/stale-actions.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Mark or close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v4
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
# Staling issues and PR's
14+
days-before-stale: 30
15+
stale-issue-label: stale
16+
stale-pr-label: stale
17+
stale-issue-message: |
18+
This issue has been automatically marked as stale because it has been open 30 days
19+
with no activity. Remove stale label or comment or this issue will be closed in 10 days
20+
stale-pr-message: |
21+
This PR has been automatically marked as stale because it has been open 30 days
22+
with no activity. Remove stale label or comment or this PR will be closed in 10 days
23+
# Not stale if have this labels or part of milestone
24+
exempt-issue-labels: bug,wip,on-hold
25+
exempt-pr-labels: bug,wip,on-hold
26+
exempt-all-milestones: true
27+
# Close issue operations
28+
# Label will be automatically removed if the issues are no longer closed nor locked.
29+
days-before-close: 10
30+
delete-branch: true
31+
close-issue-message: This issue was automatically closed because of stale in 10 days
32+
close-pr-message: This PR was automatically closed because of stale in 10 days

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ repos:
2626
rev: v4.1.0
2727
hooks:
2828
- id: check-merge-conflict
29+
- id: end-of-file-fixer

.releaserc.json

+13-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@
55
],
66
"ci": false,
77
"plugins": [
8-
"@semantic-release/commit-analyzer",
9-
"@semantic-release/release-notes-generator",
8+
[
9+
"@semantic-release/commit-analyzer",
10+
{
11+
"preset": "conventionalcommits"
12+
}
13+
],
14+
[
15+
"@semantic-release/release-notes-generator",
16+
{
17+
"preset": "conventionalcommits"
18+
}
19+
],
1020
[
1121
"@semantic-release/github",
1222
{
13-
"successComment":
14-
"This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
23+
"successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
1524
"labels": false,
1625
"releasedLabels": false
1726
}

examples/iam-policy/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ module "iam_policy_optional" {
5858
source = "../../modules/iam-policy"
5959

6060
create_policy = false
61-
}
61+
}

examples/iam-read-only-policy/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ resource "aws_ssoadmin_permission_set_inline_policy" "example" {
6363
inline_policy = module.read_only_iam_policy_doc.policy_json
6464
instance_arn = aws_ssoadmin_permission_set.example.instance_arn
6565
permission_set_arn = aws_ssoadmin_permission_set.example.arn
66-
}
66+
}

modules/iam-account/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ resource "aws_iam_account_password_policy" "this" {
1919
require_numbers = var.require_numbers
2020
require_symbols = var.require_symbols
2121
}
22-

modules/iam-account/outputs.tf

-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ output "iam_account_password_policy_expire_passwords" {
1717
description = "Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present."
1818
value = element(concat(aws_iam_account_password_policy.this.*.expire_passwords, [""]), 0)
1919
}
20-

modules/iam-account/variables.tf

-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,3 @@ variable "require_symbols" {
6868
type = bool
6969
default = true
7070
}
71-

modules/iam-assumable-role-with-oidc/variables.tf

-1
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,3 @@ variable "force_detach_policies" {
100100
type = bool
101101
default = false
102102
}
103-

modules/iam-assumable-roles/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,3 @@ resource "aws_iam_role_policy_attachment" "readonly" {
114114
role = aws_iam_role.readonly[0].name
115115
policy_arn = element(var.readonly_role_policy_arns, count.index)
116116
}
117-

modules/iam-assumable-roles/outputs.tf

-1
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,3 @@ output "readonly_iam_role_requires_mfa" {
7575
description = "Whether readonly IAM role requires MFA"
7676
value = var.readonly_role_requires_mfa
7777
}
78-

modules/iam-assumable-roles/variables.tf

-1
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,3 @@ variable "force_detach_policies" {
156156
type = bool
157157
default = false
158158
}
159-

modules/iam-group-with-assumable-roles-policy/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ resource "aws_iam_group_membership" "this" {
3030
name = var.name
3131
users = var.group_users
3232
}
33-

modules/iam-group-with-assumable-roles-policy/outputs.tf

-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ output "group_arn" {
2222
description = "IAM group arn"
2323
value = aws_iam_group.this.arn
2424
}
25-

modules/iam-group-with-assumable-roles-policy/variables.tf

-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ variable "tags" {
2020
type = map(string)
2121
default = {}
2222
}
23-

modules/iam-group-with-policies/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,3 @@ resource "aws_iam_policy" "custom" {
6161

6262
tags = var.tags
6363
}
64-

modules/iam-group-with-policies/outputs.tf

-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ output "group_name" {
1717
description = "IAM group name"
1818
value = element(concat(aws_iam_group.this.*.name, [var.name]), 0)
1919
}
20-

modules/iam-group-with-policies/policies.tf

-1
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,3 @@ data "aws_iam_policy_document" "iam_self_management" {
9191
}
9292
}
9393
}
94-

modules/iam-read-only-policy/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ data "aws_iam_policy_document" "combined" {
8787
data.aws_iam_policy_document.logs_query.*.json,
8888
[var.additional_policy_json]
8989
)
90-
}
90+
}

modules/iam-read-only-policy/outputs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ output "path" {
3131
output "policy" {
3232
description = "The policy document"
3333
value = element(concat(aws_iam_policy.policy.*.policy, [""]), 0)
34-
}
34+
}

modules/iam-read-only-policy/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ variable "web_console_services" {
6161
description = "List of web console services to allow"
6262
type = list(string)
6363
default = ["resource-groups", "tag", "health"]
64-
}
64+
}

modules/iam-user/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ resource "aws_iam_user_ssh_key" "this" {
3838
encoding = var.ssh_key_encoding
3939
public_key = var.ssh_public_key
4040
}
41-

0 commit comments

Comments
 (0)