Skip to content

Commit 93318cf

Browse files
authored
chore: sync with latest template state (#18)
This PR syncs the repository with the latest state from [terraform-module-template](https://github.com/masterpointio/terraform-module-template). **Template Version:** - **Tag:** [v0.8.1](https://github.com/masterpointio/terraform-module-template/releases/tag/v0.8.1) - **Commit SHA:** 9ef513a **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 fe48908 commit 93318cf

File tree

5 files changed

+14
-97
lines changed

5 files changed

+14
-97
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Order is important: the last matching pattern takes the most precedence
55

66
# These owners will be the default owners for everything
7-
* @masterpointio/masterpoint-open-source
7+
* @masterpointio/masterpoint-open-source

.github/workflows/trunk-upgrade.yaml

Lines changed: 6 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -19,93 +19,10 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121

22-
- name: Create Token for MasterpointBot App
23-
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0
24-
id: generate-token
22+
- name: Run Trunk Upgrade
23+
uses: masterpointio/github-action-trunk-upgrade@v0.1.0
2524
with:
26-
app_id: ${{ secrets.MP_BOT_APP_ID }}
27-
private_key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }}
28-
29-
- name: Upgrade
30-
id: trunk-upgrade
31-
uses: trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
32-
with:
33-
github-token: ${{ steps.generate-token.outputs.token }}
34-
reviewers: "@masterpointio/masterpoint-internal"
35-
prefix: "chore: "
36-
37-
- name: Wait for checks to pass + Merge PR
38-
if: steps.trunk-upgrade.outputs.pull-request-number != ''
39-
env:
40-
GH_TOKEN: ${{ secrets.MASTERPOINT_TEAM_PAT }}
41-
PR_NUMBER: ${{ steps.trunk-upgrade.outputs.pull-request-number }}
42-
run: |
43-
echo "Waiting for status checks to pass on PR #$PR_NUMBER..."
44-
45-
# Wait a bit for checks to start
46-
echo "Waiting 30 seconds for checks to initialize..."
47-
sleep 30
48-
49-
# Try to get all checks first to see if any exist
50-
ALL_CHECKS_JSON=$(gh pr checks "$PR_NUMBER" --json state,bucket || echo "[]")
51-
echo "All checks: $ALL_CHECKS_JSON"
52-
53-
# Get required checks
54-
REQUIRED_CHECKS_JSON=$(gh pr checks "$PR_NUMBER" --required --json state,bucket || echo "[]")
55-
echo "Required checks: $REQUIRED_CHECKS_JSON"
56-
57-
# Check if we have any required checks
58-
REQUIRED_CHECKS_COUNT=$(echo "$REQUIRED_CHECKS_JSON" | jq '. | length')
59-
ALL_CHECKS_COUNT=$(echo "$ALL_CHECKS_JSON" | jq '. | length')
60-
61-
if [ "$REQUIRED_CHECKS_COUNT" -eq 0 ] && [ "$ALL_CHECKS_COUNT" -eq 0 ]; then
62-
echo "No status checks found. This might be expected if no checks are configured."
63-
echo "Proceeding with auto-approval and merge..."
64-
65-
# Auto-approve the PR
66-
gh pr review "$PR_NUMBER" --approve --body "Auto-approved by trunk upgrade workflow (no status checks configured)"
67-
68-
# Merge the PR
69-
gh pr merge "$PR_NUMBER" --squash --delete-branch --admin
70-
exit 0
71-
fi
72-
73-
# If we have required checks, wait for them. Otherwise, wait for all checks.
74-
if [ "$REQUIRED_CHECKS_COUNT" -gt 0 ]; then
75-
echo "Waiting for $REQUIRED_CHECKS_COUNT required status checks..."
76-
CHECKS_TO_MONITOR="required"
77-
else
78-
echo "No required checks configured. Waiting for all $ALL_CHECKS_COUNT status checks..."
79-
CHECKS_TO_MONITOR="all"
80-
fi
81-
82-
# Wait for checks to complete
83-
while true; do
84-
if [ "$CHECKS_TO_MONITOR" = "required" ]; then
85-
CHECKS_JSON=$(gh pr checks "$PR_NUMBER" --required --json state,bucket)
86-
else
87-
CHECKS_JSON=$(gh pr checks "$PR_NUMBER" --json state,bucket)
88-
fi
89-
90-
echo "Current checks status: $CHECKS_JSON"
91-
92-
if echo "$CHECKS_JSON" | jq -e '.[] | select(.bucket=="fail")' > /dev/null; then
93-
echo "One or more checks have failed. Exiting..."
94-
exit 1
95-
fi
96-
97-
FAILED_OR_PENDING_CHECKS=$(echo "$CHECKS_JSON" | jq '[.[] | select(.state!="SUCCESS" or .bucket!="pass")] | length')
98-
if [ "$FAILED_OR_PENDING_CHECKS" -eq 0 ]; then
99-
echo "All checks passed. Auto-approving and merging PR https://github.com/${{ github.repository }}/pull/$PR_NUMBER..."
100-
101-
# Auto-approve the PR
102-
gh pr review "$PR_NUMBER" --approve --body "Auto-approved by trunk upgrade workflow"
103-
104-
# Merge the PR
105-
gh pr merge "$PR_NUMBER" --squash --delete-branch --admin
106-
break
107-
else
108-
echo "Some checks are still running or pending. Retrying in 30s..."
109-
sleep 30
110-
fi
111-
done
25+
app-id: ${{ secrets.MP_BOT_APP_ID }}
26+
app-private-key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }}
27+
github-token: ${{ secrets.MASTERPOINT_TEAM_PAT }}
28+
reviewers: "@masterpointio/masterpoint-open-source"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ backend.tf.json
4040

4141
# Other
4242
**/*.backup
43-
***/*.tmp
43+
**/*.tmp
4444
**/*.temp
4545
**/*.bak
4646
**/*.*swp

.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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cli:
77
plugins:
88
sources:
99
- id: trunk
10-
ref: v1.7.1
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:
@@ -23,13 +23,13 @@ lint:
2323
- renovate@41.46.8
2424
- tofu@1.10.4
2525
- actionlint@1.7.7
26-
- checkov@3.2.447
26+
- checkov@3.2.457
2727
- git-diff-check
2828
- markdownlint@0.45.0
2929
- prettier@3.6.2
30-
- tflint@0.58.0
31-
- trivy@0.63.0
32-
- trufflehog@3.89.2
30+
- tflint@0.58.1
31+
- trivy@0.64.1
32+
- trufflehog@3.90.2
3333
- yamllint@1.37.1
3434
ignore:
3535
- linters: [tofu]

0 commit comments

Comments
 (0)