Skip to content

Commit deea185

Browse files
authored
chore: sync with latest template state (#46)
This PR syncs the repository with the latest state from . **Changes include:** - Updated configuration files (.checkov.yaml, .markdownlint.yaml, etc.) - Updated GitHub workflows and templates - Updated linting and formatting configurations - Updated documentation templates
1 parent f8a5316 commit deea185

File tree

10 files changed

+92
-14
lines changed

10 files changed

+92
-14
lines changed
File renamed without changes.

.github/workflows/lint.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ concurrency:
44
group: lint-${{ github.head_ref || github.run_id }}
55
cancel-in-progress: true
66

7-
on: pull_request
7+
on: pull_request_target
88

99
permissions:
1010
actions: read
@@ -20,6 +20,10 @@ jobs:
2020
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121
- name: Trunk Check
2222
uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
23+
env:
24+
# NOTE: inject the GITHUB_TOKEN for the trunk managed tflint linter
25+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2327

2428
conventional-title:
2529
runs-on: ubuntu-latest

.github/workflows/release-please.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ jobs:
1414
release-please:
1515
runs-on: ubuntu-latest
1616
steps:
17+
- name: Create Token for MasterpointBot App
18+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0
19+
id: generate-token
20+
with:
21+
app_id: ${{ secrets.MP_BOT_APP_ID }}
22+
private_key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }}
23+
1724
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f #v4.1.3
1825
with:
26+
token: ${{ steps.generate-token.outputs.token }}
1927
release-type: terraform-module

.github/workflows/trunk-upgrade.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,29 @@ jobs:
3434
reviewers: "@masterpointio/masterpoint-internal"
3535
prefix: "chore: "
3636

37-
- name: Merge PR automatically
37+
- name: Wait for checks to pass + Merge PR
3838
if: steps.trunk-upgrade.outputs.pull-request-number != ''
3939
env:
40-
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
40+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
4141
PR_NUMBER: ${{ steps.trunk-upgrade.outputs.pull-request-number }}
4242
run: |
43-
gh pr merge "$PR_NUMBER" --squash --auto --delete-branch
43+
echo "Waiting for required status checks to pass on PR #$PR_NUMBER..."
44+
while true; do
45+
CHECKS_JSON=$(gh pr checks "$PR_NUMBER" --required --json state,bucket)
46+
echo "Current checks status: $CHECKS_JSON"
47+
48+
if echo "$CHECKS_JSON" | jq -e '.[] | select(.bucket=="fail")' > /dev/null; then
49+
echo "One or more required checks have failed. Exiting..."
50+
exit 1
51+
fi
52+
53+
FAILED_OR_PENDING_CHECKS=$(echo "$CHECKS_JSON" | jq '[.[] | select(.state!="SUCCESS" or .bucket!="pass")] | length')
54+
if [ "$FAILED_OR_PENDING_CHECKS" -eq 0 ]; then
55+
echo "All required checks passed. Merging PR https://github.com/${{ github.repository }}/pull/$PR_NUMBER..."
56+
gh pr merge "$PR_NUMBER" --squash --delete-branch --admin
57+
break
58+
else
59+
echo "Some required checks are still running or pending. Retrying in 30s..."
60+
sleep 30
61+
fi
62+
done

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# IDE/Editor settings
1717
**/.idea
1818
**/*.iml
19+
.cursor/
1920
.vscode/
2021
*.orig
2122
*.draft
@@ -44,3 +45,7 @@ backend.tf.json
4445
**/*.bak
4546
**/*.*swp
4647
**/.DS_Store
48+
49+
# Claude Code - we beleive engineers are responsible for the code they push no matter how it's generated.
50+
# Therefore, configs specific to their coding practices are their responsibilty to judiciously manage.
51+
.claude/*
File renamed without changes.

.tflint.hcl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
plugin "terraform" {
2+
enabled = true
3+
preset = "all"
4+
}
5+
6+
config {
7+
format = "compact"
8+
9+
# Inspect vars passed into "module" blocks. eg, lint AMI value passed into ec2 module.
10+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/calling-modules.md
11+
call_module_type = "all"
12+
13+
# default values but keeping them here for clarity
14+
disabled_by_default = false
15+
force = false
16+
}
17+
18+
# Installing tflint rulesets from Github requires setting a GITHUB_TOKEN
19+
# environment variable. Without it, you'll get an error like this:
20+
# $ tflint --init
21+
# Installing "aws" plugin...
22+
# Failed to install a plugin; Failed to fetch GitHub releases: GET https://api.github.com/repos/terraform-linters/tflint-ruleset-aws/releases/tags/v0.39.0: 401 Bad credentials []
23+
#
24+
# The solution is to provide a github PAT via a GITHUB_TOKEN env var,
25+
# export GITHUB_TOKEN=github_pat_120abc123def456ghi789jkl123mno456pqr789stu123vwx456yz789
26+
#
27+
# See docs for more info: https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
28+
plugin "aws" {
29+
enabled = true
30+
version = "0.39.0"
31+
source = "github.com/terraform-linters/tflint-ruleset-aws"
32+
deep_check = false
33+
}
34+
35+
# Allow variables to exist in more files than ONLY variables.tf
36+
# Example use cases where we prefer for variables to exist in context,
37+
# - context.tf (applicable to the null-label module)
38+
# - providers.tf (when passing in secret keys from SOPs - example, github provider)
39+
# https://github.com/terraform-linters/tflint-ruleset-terraform/blob/main/docs/rules/terraform_standard_module_structure.md
40+
rule "terraform_standard_module_structure" {
41+
enabled = false
42+
}

.trunk/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
plugins
77
user_trunk.yaml
88
user.yaml
9-
tmp
9+
tmp

.trunk/trunk.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
33
version: 0.1
44
cli:
5-
version: 1.22.15
5+
version: 1.24.0
66
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
77
plugins:
88
sources:
99
- id: trunk
10-
ref: v1.6.8
10+
ref: v1.7.0
1111
uri: https://github.com/trunk-io/plugins
1212
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
1313
runtimes:
1414
enabled:
15-
- node@18.20.5
15+
- node@22.16.0
1616
- python@3.10.8
1717
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
1818
lint:
1919
disabled:
2020
# Incompatible with some Terraform features: https://github.com/tenable/terrascan/issues/1331
2121
- terrascan
2222
enabled:
23-
- renovate@40.0.6
23+
- renovate@40.36.2
2424
- tofu@1.9.1
2525
- actionlint@1.7.7
26-
- checkov@3.2.420
26+
- checkov@3.2.435
2727
- git-diff-check
28-
- markdownlint@0.44.0
28+
- markdownlint@0.45.0
2929
- prettier@3.5.3
30-
- tflint@0.57.0
31-
- trivy@0.62.1
32-
- trufflehog@3.88.29
30+
- tflint@0.58.0
31+
- trivy@0.63.0
32+
- trufflehog@3.88.35
3333
- yamllint@1.37.1
3434
ignore:
3535
- linters: [tofu]
File renamed without changes.

0 commit comments

Comments
 (0)