Skip to content

Commit

Permalink
use tfprovidercheck (#2014)
Browse files Browse the repository at this point in the history
* use tfprovidercheck

* chore(aqua): update aqua/aqua-checksums.json

---------

Co-authored-by: suzuki-shunsuke-app[bot] <91834585+suzuki-shunsuke-app[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 01aa1f3 commit 87e9ba2
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/wc-enable-automerge.yaml
Original file line number Diff line number Diff line change
@@ -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}}
34 changes: 34 additions & 0 deletions .github/workflows/wc-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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}}
Expand Down
30 changes: 30 additions & 0 deletions aqua/aqua-checksums.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions aqua/imports/tfprovidercheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- name: suzuki-shunsuke/tfprovidercheck@v0.2.0

0 comments on commit 87e9ba2

Please sign in to comment.