File tree Expand file tree Collapse file tree 10 files changed +92
-14
lines changed Expand file tree Collapse file tree 10 files changed +92
-14
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ concurrency:
4
4
group : lint-${{ github.head_ref || github.run_id }}
5
5
cancel-in-progress : true
6
6
7
- on : pull_request
7
+ on : pull_request_target
8
8
9
9
permissions :
10
10
actions : read
20
20
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21
21
- name : Trunk Check
22
22
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 }}
23
27
24
28
conventional-title :
25
29
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 14
14
release-please :
15
15
runs-on : ubuntu-latest
16
16
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
+
17
24
- uses : googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
18
25
with :
26
+ token : ${{ steps.generate-token.outputs.token }}
19
27
release-type : terraform-module
Original file line number Diff line number Diff line change @@ -34,10 +34,29 @@ jobs:
34
34
reviewers : " @masterpointio/masterpoint-internal"
35
35
prefix : " chore: "
36
36
37
- - name : Merge PR automatically
37
+ - name : Wait for checks to pass + Merge PR
38
38
if : steps.trunk-upgrade.outputs.pull-request-number != ''
39
39
env :
40
- GITHUB_TOKEN : ${{ steps.generate-token.outputs.token }}
40
+ GH_TOKEN : ${{ steps.generate-token.outputs.token }}
41
41
PR_NUMBER : ${{ steps.trunk-upgrade.outputs.pull-request-number }}
42
42
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
Original file line number Diff line number Diff line change 16
16
# IDE/Editor settings
17
17
** /.idea
18
18
** /* .iml
19
+ .cursor /
19
20
.vscode /
20
21
* .orig
21
22
* .draft
@@ -44,3 +45,7 @@ backend.tf.json
44
45
** /* .bak
45
46
** /* . * swp
46
47
** /.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.
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change 6
6
plugins
7
7
user_trunk.yaml
8
8
user.yaml
9
- tmp
9
+ tmp
Original file line number Diff line number Diff line change 2
2
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
3
3
version : 0.1
4
4
cli :
5
- version : 1.22.15
5
+ version : 1.24.0
6
6
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
7
7
plugins :
8
8
sources :
9
9
- id : trunk
10
- ref : v1.6.8
10
+ ref : v1.7.0
11
11
uri : https://github.com/trunk-io/plugins
12
12
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
13
13
runtimes :
14
14
enabled :
15
- - node@18.20.5
15
+ - node@22.16.0
16
16
- python@3.10.8
17
17
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
18
18
lint :
19
19
disabled :
20
20
# Incompatible with some Terraform features: https://github.com/tenable/terrascan/issues/1331
21
21
- terrascan
22
22
enabled :
23
- - renovate@40.0.6
23
+ - renovate@40.36.2
24
24
- tofu@1.9.1
25
25
- actionlint@1.7.7
26
- - checkov@3.2.420
26
+ - checkov@3.2.435
27
27
- git-diff-check
28
- - markdownlint@0.44 .0
28
+ - markdownlint@0.45 .0
29
29
- 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
33
33
- yamllint@1.37.1
34
34
ignore :
35
35
- linters : [tofu]
File renamed without changes.
You can’t perform that action at this time.
0 commit comments