File tree Expand file tree Collapse file tree 9 files changed +83
-5
lines changed
Expand file tree Collapse file tree 9 files changed +83
-5
lines changed File renamed without changes.
Original file line number Diff line number Diff 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
99permissions :
1010 actions : read
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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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.
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 66plugins
77user_trunk.yaml
88user.yaml
9- tmp
9+ tmp
File renamed without changes.
You can’t perform that action at this time.
0 commit comments