diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e92f2e666..854b484d1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -46,23 +46,15 @@ jobs: enable-automerge: # This job is used for main branch's branch protection rule's status check. # If all dependent jobs succeed or are skipped this job succeeds. - runs-on: ubuntu-latest + uses: ./.github/workflows/wc-enable-automerge.yaml needs: - status-check permissions: {} + secrets: + gh_app_id: ${{secrets.APP_ID}} + gh_app_private_key: ${{secrets.APP_PRIVATE_KEY}} if: | ! failure() && ! cancelled() && github.event.pull_request.user.login == 'renovate[bot]' && contains(github.event.pull_request.body, ' **Automerge**: Enabled.') - steps: - - uses: suzuki-shunsuke/github-token-action@04d633c696e9d09e958c8b815c75db9606d6d927 # v0.2.0 - id: token - with: - github_app_id: ${{secrets.APP_ID}} - github_app_private_key: ${{secrets.APP_PRIVATE_KEY}} - - - run: gh -R "$GITHUB_REPOSITORY" pr merge --squash --auto --delete-branch "$PR_NUMBER" - env: - GITHUB_TOKEN: ${{steps.token.outputs.token}} # Use GitHub App to trigger GitHub Actions Workflow by merge commit. - PR_NUMBER: ${{github.event.pull_request.number}} # This job is used for branch protection rule # Add this job to `Status checks that are required` diff --git a/.github/workflows/wc-enable-automerge.yaml b/.github/workflows/wc-enable-automerge.yaml new file mode 100644 index 000000000..bc8d0d4b8 --- /dev/null +++ b/.github/workflows/wc-enable-automerge.yaml @@ -0,0 +1,29 @@ +--- +name: enable-automerge +on: + workflow_call: + secrets: + gh_app_id: + required: false + gh_app_private_key: + required: false + +jobs: + enable-automerge: + runs-on: ubuntu-latest + permissions: {} + steps: + - uses: tibdex/github-app-token@v2.1.0 + id: token + with: + app_id: ${{secrets.gh_app_id}} + private_key: ${{secrets.gh_app_private_key}} + permissions: >- + {"pull_requests": "write", "contents: "write"} + repositories: >- + ["${{github.repository}}"] + + - run: gh -R "$GITHUB_REPOSITORY" pr merge --squash --auto --delete-branch "$PR_NUMBER" + env: + GITHUB_TOKEN: ${{steps.token.outputs.token}} # Use GitHub App to trigger GitHub Actions Workflow by merge commit. + PR_NUMBER: ${{github.event.pull_request.number}} diff --git a/.github/workflows/wc-test.yaml b/.github/workflows/wc-test.yaml index 478b2591d..802573c98 100644 --- a/.github/workflows/wc-test.yaml +++ b/.github/workflows/wc-test.yaml @@ -123,6 +123,23 @@ jobs: github_app_token: ${{steps.token.outputs.token}} ssh_key: ${{secrets.terraform_private_module_ssh_key}} # This isn't needed if you don't use SSH key to checkout private Terraform Modules + - uses: suzuki-shunsuke/tfaction/get-target-config@26effa08b92b77b5cfe04e2a25c15845fd00b04f # v0.7.2 + id: target-config + + - run: | + set -euo pipefail + tfprovidercheck -v + github-comment exec -- terraform version -json | github-comment exec -- tfprovidercheck + working-directory: ${{ steps.target-config.outputs.working_directory }} + env: + TFPROVIDERCHECK_CONFIG_BODY: | + providers: + - name: registry.terraform.io/hashicorp/google + - name: registry.terraform.io/hashicorp/aws + - name: registry.terraform.io/hashicorp/null + - name: registry.terraform.io/integrations/github + GITHUB_TOKEN: ${{steps.token.outputs.token}} # For github-comment + - uses: suzuki-shunsuke/tfaction/test@26effa08b92b77b5cfe04e2a25c15845fd00b04f # v0.7.2 with: github_app_token: ${{steps.token.outputs.token}} @@ -174,6 +191,23 @@ jobs: github_app_token: ${{steps.token.outputs.token}} ssh_key: ${{secrets.terraform_private_module_ssh_key}} # This isn't needed if you don't use SSH key to checkout private Terraform Modules + - uses: suzuki-shunsuke/tfaction/get-target-config@26effa08b92b77b5cfe04e2a25c15845fd00b04f # v0.7.2 + id: target-config + + - run: | + set -euo pipefail + tfprovidercheck -v + github-comment exec -- terraform version -json | github-comment exec -- tfprovidercheck + working-directory: ${{ steps.target-config.outputs.working_directory }} + env: + TFPROVIDERCHECK_CONFIG_BODY: | + providers: + - name: registry.terraform.io/hashicorp/google + - name: registry.terraform.io/hashicorp/aws + - name: registry.terraform.io/hashicorp/null + - name: registry.terraform.io/integrations/github + GITHUB_TOKEN: ${{steps.token.outputs.token}} # For github-comment + - uses: suzuki-shunsuke/tfaction/test@26effa08b92b77b5cfe04e2a25c15845fd00b04f # v0.7.2 with: github_app_token: ${{steps.token.outputs.token}} diff --git a/aqua/aqua-checksums.json b/aqua/aqua-checksums.json index fc3e246fa..78b88d917 100644 --- a/aqua/aqua-checksums.json +++ b/aqua/aqua-checksums.json @@ -320,6 +320,36 @@ "checksum": "3196C4361366BCD832D49A6DA7C4E4371DB5C56FDF9753DD60FB908D9C99FFC5", "algorithm": "sha256" }, + { + "id": "github_release/github.com/suzuki-shunsuke/tfprovidercheck/v0.2.0/tfprovidercheck_darwin_amd64.tar.gz", + "checksum": "925946B23ACF2284F7C16A21FB9222F00BED30A000270FA9804B168102E386CF", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/suzuki-shunsuke/tfprovidercheck/v0.2.0/tfprovidercheck_darwin_arm64.tar.gz", + "checksum": "2642EF830F55B239DA3E39B0C945C3F8404101448CE3B8133EFBE009A059C340", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/suzuki-shunsuke/tfprovidercheck/v0.2.0/tfprovidercheck_linux_amd64.tar.gz", + "checksum": "8830574F4DB9BCE9DD5CBBCE31E512BABD405DA0D7EC1B80555FAACABC5C87E9", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/suzuki-shunsuke/tfprovidercheck/v0.2.0/tfprovidercheck_linux_arm64.tar.gz", + "checksum": "3AE5BE3649AA8486D85268E01298CBEB5F092719AC2B40EE3FBC5EA3D87A0B56", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/suzuki-shunsuke/tfprovidercheck/v0.2.0/tfprovidercheck_windows_amd64.zip", + "checksum": "B2EC6975A98E5EFA9AA65C43DAF1C86DB2DF72F98515B0F7F7C5EBA94D5BCBAC", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/suzuki-shunsuke/tfprovidercheck/v0.2.0/tfprovidercheck_windows_arm64.zip", + "checksum": "D11BB3ED8D8AC06262D7ABC621BE1FC82F9FA4E2D4DCEF70D43898AAD4A3BACB", + "algorithm": "sha256" + }, { "id": "github_release/github.com/terraform-docs/terraform-docs/v0.16.0/terraform-docs-v0.16.0-darwin-amd64.tar.gz", "checksum": "F48422E2E3C4A30852992177DB17CB37B18810A3E8392401BA69E875C8BB1090", diff --git a/aqua/imports/tfprovidercheck.yaml b/aqua/imports/tfprovidercheck.yaml new file mode 100644 index 000000000..10dad1538 --- /dev/null +++ b/aqua/imports/tfprovidercheck.yaml @@ -0,0 +1,2 @@ +packages: + - name: suzuki-shunsuke/tfprovidercheck@v0.2.0