diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4a035e9..51080ca 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,4 +4,4 @@ # Order is important: the last matching pattern takes the most precedence # These owners will be the default owners for everything -* @masterpointio/masterpoint-internal \ No newline at end of file +* @masterpointio/masterpoint-open-source \ No newline at end of file diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 0ab4bd8..275d017 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,27 +3,62 @@ "config:best-practices", "github>aquaproj/aqua-renovate-config#2.7.5" ], - "schedule": [ - "after 9am on the first day of the month" - ], - "assigneesFromCodeOwners": true, - "dependencyDashboardAutoclose": true, - "addLabels": [ - "auto-upgrade" - ], "enabledManagers": [ - "terraform" + "terraform", + "github-actions" ], "terraform": { "ignorePaths": [ "**/context.tf" // Mixin file https://github.com/cloudposse/terraform-null-label/blob/main/exports/context.tf + ], + "fileMatch": [ + "\\.tf$", + "\\.tofu$" ] }, + "schedule": [ + "after 9am on the first day of the month" + ], + "assigneesFromCodeOwners": true, + "dependencyDashboardAutoclose": true, + "addLabels": ["{{manager}}"], "packageRules": [ { - "matchDepTypes": [ - "optionalDependencies" - ] + "matchManagers": ["github-actions"], + "matchUpdateTypes": ["minor", "patch", "pin", "digest"], + "automerge": true, + "automergeType": "branch", + "groupName": "github-actions-auto-upgrade", + "addLabels": ["auto-upgrade"] + }, + { + "matchManagers": ["github-actions"], + "matchUpdateTypes": ["major"], + "groupName": "github-actions-needs-review", + "addLabels": ["needs-review"] + }, + { + "matchManagers": ["terraform"], + "groupName": "tf", + "addLabels": ["needs-review"] + }, + { + "matchFileNames": ["**/*.tofu", "**/*.tf"], + "matchDatasources": ["terraform-provider", "terraform-module"], + "registryUrls": ["https://registry.opentofu.org"], + "groupName": "tf" + }, + { + "matchFileNames": ["**/*.tofu"], + "matchDepTypes": ["required_version"], + "registryUrls": ["https://registry.opentofu.org"], + "groupName": "tf" + }, + { + "matchFileNames": ["**/*.tf"], + "matchDepTypes": ["required_version"], + "registryUrls": ["https://registry.terraform.io"], + "groupName": "tf" } ] -} \ No newline at end of file +} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 092d215..2bbb389 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,5 +1,9 @@ name: Lint +concurrency: + group: lint-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + on: pull_request permissions: @@ -13,6 +17,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out Git repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Trunk Check - uses: trunk-io/trunk-action@v1 + uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19 + + conventional-title: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 421aab2..e9e712a 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -8,7 +8,7 @@ on: permissions: contents: write pull-requests: write - issues: write # required for label creation + issues: write jobs: release-please: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 400b365..330fbbb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,7 +4,7 @@ on: push: branches: - main - pull_request: + pull_request_target: permissions: actions: read @@ -15,31 +15,14 @@ permissions: jobs: tf-test: - name: ${{ matrix.tf }} Test + name: 🧪 ${{ matrix.tf }} test runs-on: ubuntu-latest strategy: matrix: tf: [tofu, terraform] steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Aqua Cache - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 - if: ${{ !github.event.act }} # Don't enable the cache step if we're using act for testing - with: - path: ~/.local/share/aquaproj-aqua - key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}} - restore-keys: | - v1-aqua-installer-${{runner.os}}-${{runner.arch}}- - - - name: Install Aqua - uses: aquaproj/aqua-installer@5e54e5cee8a95ee2ce7c04cb993da6dfad13e59c # v3.2.1 + - uses: masterpointio/github-action-tf-test@c3b619f3bca9e4f482b9e0fb3166ab3f02d9d54c # v1.0.0 with: - aqua_version: v2.48.1 - - - name: Aqua Install - shell: bash - run: aqua install --tags ${{ matrix.tf }} - - - run: ${{ matrix.tf }} init - - run: ${{ matrix.tf }} test + tf_type: ${{ matrix.tf }} + aws_role_arn: ${{ vars.TF_TEST_AWS_ROLE_ARN }} + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/trunk-upgrade.yaml b/.github/workflows/trunk-upgrade.yaml index 8b14fcc..d9cf480 100644 --- a/.github/workflows/trunk-upgrade.yaml +++ b/.github/workflows/trunk-upgrade.yaml @@ -17,7 +17,7 @@ jobs: pull-requests: write steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Create Token for MasterpointBot App uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0 @@ -27,8 +27,17 @@ jobs: private_key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }} - name: Upgrade - uses: trunk-io/trunk-action/upgrade@86b68ffae610a05105e90b1f52ad8c549ef482c2 #v1.1.16 + id: trunk-upgrade + uses: trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19 with: github-token: ${{ steps.generate-token.outputs.token }} reviewers: "@masterpointio/masterpoint-internal" prefix: "chore: " + + - name: Merge PR automatically + if: steps.trunk-upgrade.outputs.pull-request-number != '' + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + PR_NUMBER: ${{ steps.trunk-upgrade.outputs.pull-request-number }} + run: | + gh pr merge "$PR_NUMBER" --squash --auto --delete-branch