Skip to content

Commit d2b7081

Browse files
feat: sync from template repo (#3)
## what - sync changes as of masterpointio/terraform-module-template#37 Resolves tests getting stuck ![CleanShot 2025-05-15 at 17 17 12@2x](https://github.com/user-attachments/assets/d12412b2-ebbf-4243-acfb-36a9cc35c28c) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated repository code owners to the open-source team. - Enhanced Renovate configuration to support GitHub Actions dependencies and improved grouping/labeling for Terraform and OpenTofu updates. - Improved lint workflow with concurrency control, pinned action versions, and added a job to enforce semantic pull request titles. - Updated test workflow to use a composite action for Terraform testing and changed trigger for improved security. - Upgraded actions in the trunk-upgrade workflow and added automatic PR merging after upgrades. - Minor documentation update in the release workflow (removed a comment). <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 187687d commit d2b7081

File tree

6 files changed

+80
-42
lines changed

6 files changed

+80
-42
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-internal
7+
* @masterpointio/masterpoint-open-source

.github/renovate.json5

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,62 @@
33
"config:best-practices",
44
"github>aquaproj/aqua-renovate-config#2.7.5"
55
],
6-
"schedule": [
7-
"after 9am on the first day of the month"
8-
],
9-
"assigneesFromCodeOwners": true,
10-
"dependencyDashboardAutoclose": true,
11-
"addLabels": [
12-
"auto-upgrade"
13-
],
146
"enabledManagers": [
15-
"terraform"
7+
"terraform",
8+
"github-actions"
169
],
1710
"terraform": {
1811
"ignorePaths": [
1912
"**/context.tf" // Mixin file https://github.com/cloudposse/terraform-null-label/blob/main/exports/context.tf
13+
],
14+
"fileMatch": [
15+
"\\.tf$",
16+
"\\.tofu$"
2017
]
2118
},
19+
"schedule": [
20+
"after 9am on the first day of the month"
21+
],
22+
"assigneesFromCodeOwners": true,
23+
"dependencyDashboardAutoclose": true,
24+
"addLabels": ["{{manager}}"],
2225
"packageRules": [
2326
{
24-
"matchDepTypes": [
25-
"optionalDependencies"
26-
]
27+
"matchManagers": ["github-actions"],
28+
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
29+
"automerge": true,
30+
"automergeType": "branch",
31+
"groupName": "github-actions-auto-upgrade",
32+
"addLabels": ["auto-upgrade"]
33+
},
34+
{
35+
"matchManagers": ["github-actions"],
36+
"matchUpdateTypes": ["major"],
37+
"groupName": "github-actions-needs-review",
38+
"addLabels": ["needs-review"]
39+
},
40+
{
41+
"matchManagers": ["terraform"],
42+
"groupName": "tf",
43+
"addLabels": ["needs-review"]
44+
},
45+
{
46+
"matchFileNames": ["**/*.tofu", "**/*.tf"],
47+
"matchDatasources": ["terraform-provider", "terraform-module"],
48+
"registryUrls": ["https://registry.opentofu.org"],
49+
"groupName": "tf"
50+
},
51+
{
52+
"matchFileNames": ["**/*.tofu"],
53+
"matchDepTypes": ["required_version"],
54+
"registryUrls": ["https://registry.opentofu.org"],
55+
"groupName": "tf"
56+
},
57+
{
58+
"matchFileNames": ["**/*.tf"],
59+
"matchDepTypes": ["required_version"],
60+
"registryUrls": ["https://registry.terraform.io"],
61+
"groupName": "tf"
2762
}
2863
]
29-
}
64+
}

.github/workflows/lint.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Lint
22

3+
concurrency:
4+
group: lint-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
37
on: pull_request
48

59
permissions:
@@ -13,6 +17,13 @@ jobs:
1317
runs-on: ubuntu-latest
1418
steps:
1519
- name: Check out Git repository
16-
uses: actions/checkout@v4
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1721
- name: Trunk Check
18-
uses: trunk-io/trunk-action@v1
22+
uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
23+
24+
conventional-title:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-please.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
permissions:
99
contents: write
1010
pull-requests: write
11-
issues: write # required for label creation
11+
issues: write
1212

1313
jobs:
1414
release-please:

.github/workflows/test.yaml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
7+
pull_request_target:
88

99
permissions:
1010
actions: read
@@ -15,31 +15,14 @@ permissions:
1515

1616
jobs:
1717
tf-test:
18-
name: ${{ matrix.tf }} Test
18+
name: 🧪 ${{ matrix.tf }} test
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
2222
tf: [tofu, terraform]
2323
steps:
24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25-
26-
- name: Aqua Cache
27-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
28-
if: ${{ !github.event.act }} # Don't enable the cache step if we're using act for testing
29-
with:
30-
path: ~/.local/share/aquaproj-aqua
31-
key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}}
32-
restore-keys: |
33-
v1-aqua-installer-${{runner.os}}-${{runner.arch}}-
34-
35-
- name: Install Aqua
36-
uses: aquaproj/aqua-installer@5e54e5cee8a95ee2ce7c04cb993da6dfad13e59c # v3.2.1
24+
- uses: masterpointio/github-action-tf-test@c3b619f3bca9e4f482b9e0fb3166ab3f02d9d54c # v1.0.0
3725
with:
38-
aqua_version: v2.48.1
39-
40-
- name: Aqua Install
41-
shell: bash
42-
run: aqua install --tags ${{ matrix.tf }}
43-
44-
- run: ${{ matrix.tf }} init
45-
- run: ${{ matrix.tf }} test
26+
tf_type: ${{ matrix.tf }}
27+
aws_role_arn: ${{ vars.TF_TEST_AWS_ROLE_ARN }}
28+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/trunk-upgrade.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
pull-requests: write
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121

2222
- name: Create Token for MasterpointBot App
2323
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0
@@ -27,8 +27,17 @@ jobs:
2727
private_key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }}
2828

2929
- name: Upgrade
30-
uses: trunk-io/trunk-action/upgrade@86b68ffae610a05105e90b1f52ad8c549ef482c2 #v1.1.16
30+
id: trunk-upgrade
31+
uses: trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
3132
with:
3233
github-token: ${{ steps.generate-token.outputs.token }}
3334
reviewers: "@masterpointio/masterpoint-internal"
3435
prefix: "chore: "
36+
37+
- name: Merge PR automatically
38+
if: steps.trunk-upgrade.outputs.pull-request-number != ''
39+
env:
40+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
41+
PR_NUMBER: ${{ steps.trunk-upgrade.outputs.pull-request-number }}
42+
run: |
43+
gh pr merge "$PR_NUMBER" --squash --auto --delete-branch

0 commit comments

Comments
 (0)