Skip to content

Commit b955dc2

Browse files
committed
chore: Merge branch 'dev'
2 parents 9826177 + 8757757 commit b955dc2

File tree

8 files changed

+143
-23
lines changed

8 files changed

+143
-23
lines changed

.github/labeler.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Feature:
2+
- head-branch: ['^feature', 'feature']
3+
Hotfix:
4+
- head-branch: ['^hotfix', 'hotfix']
5+
Documentation:
6+
- changed-files:
7+
- any-glob-to-any-file: '**/*.md'
8+
CICD:
9+
- changed-files:
10+
- any-glob-to-any-file: '.github/**'
11+
12+
typescript:
13+
- changed-files:
14+
- any-glob-to-any-file: '**/*.ts'
15+
css:
16+
- changed-files:
17+
- any-glob-to-any-file: '**/*.css'
18+
19+

.github/pull_request_template.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Description
2+
3+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
# How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
19+
20+
- [ ] Test A
21+
- [ ] Test B
22+
23+
24+
# Checklist:
25+
26+
- [ ] My code follows the style guidelines of this project
27+
- [ ] I have performed a self-review of my code
28+
- [ ] I have commented my code, particularly in hard-to-understand areas
29+
- [ ] I have made corresponding changes to the documentation
30+
- [ ] My changes generate no new warnings
31+
- [ ] I have added tests or screenshots that prove my fix is effective or that my feature works
32+
- [ ] Any dependent changes have been merged and published in downstream modules
33+

.github/reviewers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
reviewers:
2+
defaults:
3+
- repository-owners
4+
- bbrauneck

.github/workflows/dependabot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: Dependabot metadata
1313
id: dependabot-metadata
14-
uses: dependabot/fetch-metadata@v1.3.1
14+
uses: dependabot/fetch-metadata@v1.3.2
1515
with:
1616
github-token: ${{ secrets.GITHUB_TOKEN }}
1717
- name: Approve a PR

.github/workflows/labelling.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: label PRs
2+
on:
3+
pull_request:
4+
branches: [dev, master]
5+
jobs:
6+
size-label:
7+
needs: pr-reviewer
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: size-label
14+
uses: "pascalgn/size-label-action@v0.5.0"
15+
env:
16+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
17+
with:
18+
sizes: >
19+
{
20+
"0": "XS",
21+
"20": "S",
22+
"50": "M",
23+
"200": "L",
24+
"800": "XL",
25+
"2000": "XXL"
26+
}
27+
- name: general-labels
28+
uses: actions/labeler@v5
29+
with:
30+
sync-labels: true
31+
pr-reviewer:
32+
permissions:
33+
contents: read
34+
pull-requests: write
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v3
39+
with:
40+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
41+
fetch-depth: 0
42+
- name: Request review and assign
43+
uses: necojackarc/auto-request-review@v0.13.0
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
config: .github/reviewers.yml
47+
use_local: true

.pre-commit-config.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
repos:
33
- repo: https://github.com/compilerla/conventional-pre-commit
4-
rev: v1.2.0
4+
rev: v3.2.0
55
hooks:
66
- id: conventional-pre-commit
77
stages: [commit-msg]
88
args: []
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.1.0
10+
rev: v4.6.0
1111
hooks:
1212
- id: trailing-whitespace
1313
- id: end-of-file-fixer
@@ -32,25 +32,20 @@ repos:
3232
args:
3333
- -b main
3434
- repo: https://github.com/antonbabenko/pre-commit-terraform
35-
rev: v1.62.0
35+
rev: v1.89.1
3636
hooks:
3737
- id: terraform_fmt
38-
- id: terraform_tflint
3938
- id: terraform_docs
4039
args:
4140
- --hook-config=--path-to-file=README.md
4241
- --hook-config=--add-to-existing-file=true
4342
- --hook-config=--create-file-if-not-exist=true
44-
- repo: https://github.com/Checkmarx/kics
45-
rev: v1.5.4
46-
hooks:
47-
- id: kics
4843
- repo: https://github.com/sirosen/check-jsonschema
49-
rev: 0.13.0
44+
rev: 0.28.3
5045
hooks:
5146
- id: check-github-workflows
5247
- repo: https://github.com/pre-commit/mirrors-prettier
53-
rev: v2.5.1
48+
rev: v4.0.0-alpha.8
5449
hooks:
5550
- id: prettier
5651
stages: [commit]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Please be aware that this is mainly a copy operation which means all your curren
117117

118118
| Name | Source | Version |
119119
|------|--------|---------|
120-
| <a name="module_bucket"></a> [bucket](#module\_bucket) | git::github.com/xoap-io/terraform-aws-storage-s3.git | v0.1.0 |
120+
| <a name="module_bucket"></a> [bucket](#module\_bucket) | git::github.com/xoap-io/terraform-aws-storage-s3.git | v0.1.1 |
121121
| <a name="module_this_label"></a> [this\_label](#module\_this\_label) | git::github.com/xoap-io/terraform-aws-misc-label | v0.1.0 |
122122

123123
## Resources
@@ -127,6 +127,7 @@ Please be aware that this is mainly a copy operation which means all your curren
127127
| [aws_cloudfront_cache_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_cache_policy) | resource |
128128
| [aws_cloudfront_distribution.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution) | resource |
129129
| [aws_cloudfront_origin_request_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_origin_request_policy) | resource |
130+
| [aws_cloudfront_response_headers_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_response_headers_policy) | resource |
130131

131132
## Inputs
132133

main.tf

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module "this_label" {
44
attributes = ["hosting", var.site_name]
55
}
66
module "bucket" {
7-
source = "git::github.com/xoap-io/terraform-aws-storage-s3.git?ref=v0.1.0"
7+
source = "git::github.com/xoap-io/terraform-aws-storage-s3.git?ref=v0.1.1"
88
context = var.context
99
name = var.site_name
1010
website_enabled = true
@@ -49,6 +49,29 @@ resource "aws_cloudfront_origin_request_policy" "this" {
4949
}
5050
query_strings_config {
5151
query_string_behavior = "all"
52+
53+
}
54+
55+
}
56+
resource "aws_cloudfront_response_headers_policy" "this" {
57+
name = module.this_label.id
58+
59+
cors_config {
60+
access_control_allow_credentials = false
61+
62+
access_control_allow_headers {
63+
items = var.cors_allowed_headers
64+
}
65+
66+
access_control_allow_methods {
67+
items = concat(var.cors_allowed_methods, ["OPTIONS"])
68+
}
69+
70+
access_control_allow_origins {
71+
items = var.cors_allowed_origins
72+
}
73+
74+
origin_override = true
5275
}
5376
}
5477
#tfsec:ignore:AWS045
@@ -77,16 +100,14 @@ resource "aws_cloudfront_distribution" "this" {
77100
default_root_object = var.default_root_object
78101
aliases = var.cloudfront_aliases
79102
default_cache_behavior {
80-
allowed_methods = var.allowed_methods
81-
cached_methods = var.cached_methods
82-
target_origin_id = var.s3_origin_id
83-
compress = true
84-
cache_policy_id = aws_cloudfront_cache_policy.this.id
85-
origin_request_policy_id = aws_cloudfront_origin_request_policy.this.id
86-
viewer_protocol_policy = var.viewer_protocol_policy
87-
min_ttl = var.cf_min_ttl
88-
max_ttl = var.cf_max_ttl
89-
default_ttl = var.cf_default_ttl
103+
allowed_methods = var.allowed_methods
104+
cached_methods = var.cached_methods
105+
target_origin_id = var.s3_origin_id
106+
compress = true
107+
cache_policy_id = aws_cloudfront_cache_policy.this.id
108+
origin_request_policy_id = aws_cloudfront_origin_request_policy.this.id
109+
viewer_protocol_policy = var.viewer_protocol_policy
110+
response_headers_policy_id = aws_cloudfront_response_headers_policy.this.id
90111
}
91112
price_class = var.cf_price_class
92113
viewer_certificate {

0 commit comments

Comments
 (0)