diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 603f653293..cbf606c799 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,25 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: github-actions + directory: / + groups: + github-actions: + patterns: + - "*" + update-types: + - minor + - patch schedule: - interval: "weekly" + interval: weekly - - package-ecosystem: "gomod" - directory: "/" + - package-ecosystem: gomod + directory: / + groups: + gomod: + patterns: + - "*" + update-types: + - minor + - patch schedule: - interval: "weekly" + interval: weekly diff --git a/.github/workflows/add_to_octokit_project.yml b/.github/workflows/add_to_octokit_project.yml index e1c533150c..3e2f337f97 100644 --- a/.github/workflows/add_to_octokit_project.yml +++ b/.github/workflows/add_to_octokit_project.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/add-to-project@v0.6.0 + - uses: actions/add-to-project@0609a2702eefb44781da00f8e04901d6e5cd2b92 # v0.6.0 with: project-url: https://github.com/orgs/octokit/projects/10 github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfeee58de0..b2e5e4cec3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,11 @@ jobs: env: GITHUB_TEST_ORGANIZATION: 'kfcampbell-terraform-provider' steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - run: make tools - run: make lint - run: make website-lint diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b076e771dc..5c3d228b3c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,22 +24,24 @@ jobs: language: [ 'go' ] steps: - - name: Checkout repository - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" + - name: Checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: 'go.mod' + cache: true + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/dotcom-acceptance-tests-all.yml b/.github/workflows/dotcom-acceptance-tests-all.yml index 4161f78dc3..7a1f4d6151 100644 --- a/.github/workflows/dotcom-acceptance-tests-all.yml +++ b/.github/workflows/dotcom-acceptance-tests-all.yml @@ -16,15 +16,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Anonymous) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO RUN_ALL: true @@ -33,17 +34,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Individual) id: acceptance-tests-individual - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO RUN_ALL: true @@ -53,7 +55,7 @@ jobs: - name: Failed Acceptance Tests (Individual) if: ${{ failure() }} - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: DEBUG RUN_ALLOWED: ${{ steps.acceptance-tests-individual.outputs.failed }} @@ -65,17 +67,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Organization) id: acceptance-tests-organization - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO RUN_ALL: true @@ -84,7 +87,7 @@ jobs: GITHUB_TEST_OWNER: github-terraform-test-user - name: Failed Acceptance Tests (Organization) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 if: ${{ failure() }} with: TF_LOG: DEBUG diff --git a/.github/workflows/dotcom-acceptance-tests-manual.yml b/.github/workflows/dotcom-acceptance-tests-manual.yml index 189305e54c..3d0c41e46f 100644 --- a/.github/workflows/dotcom-acceptance-tests-manual.yml +++ b/.github/workflows/dotcom-acceptance-tests-manual.yml @@ -17,21 +17,22 @@ jobs: jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2 )" - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Anonymous) id: acceptance-tests-anonymous - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} - name: Failed Acceptance Tests (Anonymous) if: ${{ failure() }} - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: DEBUG RUN_ALLOWED: ${{ steps.acceptance-tests-anonymous.outputs.run_allowed }} @@ -48,15 +49,16 @@ jobs: jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2 )" - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Individual) id: acceptance-tests-individual - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} @@ -65,7 +67,7 @@ jobs: GITHUB_TEST_ORGANIZATION: terraformtesting - name: Failed Acceptance Tests (Individual) if: ${{ failure() }} - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: DEBUG RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} @@ -84,16 +86,17 @@ jobs: jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2 )" - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Organization) id: acceptance-tests-organization - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} @@ -102,7 +105,7 @@ jobs: GITHUB_TEST_OWNER: github-terraform-test-user - name: Failed Acceptance Tests (Organization) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 if: ${{ failure() }} with: TF_LOG: DEBUG @@ -110,6 +113,3 @@ jobs: GITHUB_ORGANIZATION: terraformtesting GITHUB_TEST_USER_TOKEN: ${{ secrets.DOTCOM_TEST_USER_TOKEN }} GITHUB_TEST_OWNER: github-terraform-test-user - - - diff --git a/.github/workflows/dotcom-acceptance-tests.yml b/.github/workflows/dotcom-acceptance-tests.yml index ae2b996a0e..1f8dccad7f 100644 --- a/.github/workflows/dotcom-acceptance-tests.yml +++ b/.github/workflows/dotcom-acceptance-tests.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - name: Acceptance Tests (Anonymous) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO @@ -24,15 +24,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Individual) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO GITHUB_OWNER: github-terraform-test-user @@ -43,15 +44,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Organization) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO GITHUB_ORGANIZATION: terraformtesting diff --git a/.github/workflows/ghes-acceptance-tests-all.yml b/.github/workflows/ghes-acceptance-tests-all.yml index 2c4668b79e..a25e14b13e 100644 --- a/.github/workflows/ghes-acceptance-tests-all.yml +++ b/.github/workflows/ghes-acceptance-tests-all.yml @@ -28,15 +28,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Anonymous) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: GITHUB_BASE_URL: "https://terraformtesting-ghe.eastus.cloudapp.azure.com/" @@ -46,17 +47,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Individual) id: acceptance-tests-individual - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO RUN_ALL: true @@ -66,7 +68,7 @@ jobs: - name: Failed Acceptance Tests (Individual) if: ${{ failure() }} - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: DEBUG RUN_ALLOWED: ${{ steps.acceptance-tests-individual.outputs.failed }} @@ -80,17 +82,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Organization) id: acceptance-tests-organization - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: TF_LOG: INFO RUN_ALL: true @@ -99,7 +102,7 @@ jobs: GITHUB_TEST_USER_TOKEN: ${{ secrets.GHES_TEST_USER_TOKEN }} - name: Failed Acceptance Tests (Organization) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 if: ${{ failure() }} with: TF_LOG: DEBUG diff --git a/.github/workflows/ghes-acceptance-tests.yml b/.github/workflows/ghes-acceptance-tests.yml index 369101754f..34b30b8748 100644 --- a/.github/workflows/ghes-acceptance-tests.yml +++ b/.github/workflows/ghes-acceptance-tests.yml @@ -23,15 +23,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Anonymous) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: GITHUB_BASE_URL: "https://terraformtesting-ghe.eastus.cloudapp.azure.com/" @@ -41,15 +42,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Individual) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: GITHUB_BASE_URL: "https://terraformtesting-ghe.eastus.cloudapp.azure.com/" GITHUB_OWNER: administrator @@ -61,15 +63,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.21' + go-version-file: 'go.mod' + cache: true - name: Acceptance Tests (Organization) - uses: terraformtesting/acceptance-tests@v2.2.0 + uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 with: GITHUB_BASE_URL: "https://terraformtesting-ghe.eastus.cloudapp.azure.com/" GITHUB_ORGANIZATION: terraformtesting diff --git a/.github/workflows/immediate-response.yml b/.github/workflows/immediate-response.yml index e8bb8ee5b8..7b102a9c57 100644 --- a/.github/workflows/immediate-response.yml +++ b/.github/workflows/immediate-response.yml @@ -19,11 +19,11 @@ jobs: run: echo "NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" - name: Respond to issue or PR - uses: peter-evans/create-or-update-comment@v4 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 with: issue-number: ${{ steps.extract.outputs.NUMBER }} body: > 👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! - We have a [process in place](https://github.com/octokit/.github/blob/main/community/prioritization_response.md#overview) for prioritizing and responding to your input. + We have a [process in place](https://github.com/octokit/.github/blob/main/community/prioritization_response.md#overview) for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with `Status: Up for grabs`. You & others like you are the reason all of this works! So thank you & happy coding! 🚀 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e95c73c747..ffb5ea6f54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,47 +1,45 @@ -# This GitHub action can publish assets for release when a tag is created. -# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). -# -# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your -# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE` -# secret. If you would rather own your own GPG handling, please fork this action -# or use an alternative one for key handling. -# -# You will need to pass the `--batch` flag to `gpg` in your signing step -# in `goreleaser` to indicate this is being used in a non-interactive mode. -# -name: release +# Terraform Provider release workflow. +name: Release + +# This GitHub action creates a release when a tag that matches the pattern +# "v*" (e.g. v0.1.0) is created. on: push: tags: - 'v*' + +# Releases need permissions to read and write the repository contents. +# GitHub considers creating releases and uploading assets as writing contents. +permissions: + contents: write + jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Unshallow - run: git fetch --prune --unshallow - - - name: Set up Go - uses: actions/setup-go@v5 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - go-version: 1.21 - - - name: Import GPG key + # Allow goreleaser to access older tag information. + fetch-depth: 0 + + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: 'go.mod' + cache: true + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 id: import_gpg - uses: paultyng/ghaction-import-gpg@v2.1.0 - env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - PASSPHRASE: ${{ secrets.PASSPHRASE }} - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + with: + args: release --clean version: latest - args: release --rm-dist env: - GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + # GitHub sets the GITHUB_TOKEN secret automatically. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5b8cc76d39..c94fc36e3d 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v9 + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 with: stale-issue-message: > 👋 Hey Friends, this issue has been automatically marked as `stale` because it has no recent activity. diff --git a/.go-version b/.go-version deleted file mode 100644 index b48f322609..0000000000 --- a/.go-version +++ /dev/null @@ -1 +0,0 @@ -1.17 diff --git a/.golangci.yml b/.golangci.yml index 9fdcbc6124..1b2e11d4f5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,3 +1,6 @@ +# Visit https://golangci-lint.run/ for usage documentation +# and information on other useful linters + run: deadline: 3m modules-download-mode: vendor @@ -9,17 +12,25 @@ issues: linters: disable-all: true enable: + - durationcheck - errcheck + - exportloopref + # - forcetypeassert + # - godot - gofmt - gosimple - ineffassign + - makezero - misspell + # - nilerr + # - predeclared - staticcheck + - tenv - unconvert + # - unparam - unused - vet linters-settings: errcheck: ignore: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set,fmt:.*,io:Close - diff --git a/.goreleaser.yml b/.goreleaser.yml index b07c411d96..c2c6bb319f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,41 +1,42 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. before: - hooks: [] + hooks: # this is just an example and not a requirement for provider building/publishing - # commenting for now to unbreak releases. this can be uncommented when we - # update from v1.17.2 to v2 of the terraform-provider-sdk. - # - go mod tidy + - go mod tidy builds: -- env: - # goreleaser does not work with CGO, it could also complicate - # usage by users in CI/CD systems like Terraform Cloud where - # they are unable to install libraries. - - CGO_ENABLED=0 - mod_timestamp: '{{ .CommitTimestamp }}' - flags: - - -trimpath - ldflags: - - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' - goos: - - freebsd - - windows - - linux - - darwin - goarch: - - amd64 - - '386' - - arm - - arm64 - ignore: - - goos: darwin - goarch: '386' - binary: '{{ .ProjectName }}_v{{ .Version }}' + - env: + # goreleaser does not work with CGO, it could also complicate + # usage by users in CI/CD systems like Terraform Cloud where + # they are unable to install libraries. + - CGO_ENABLED=0 + mod_timestamp: "{{ .CommitTimestamp }}" + flags: + - -trimpath + ldflags: + - "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}" + goos: + - freebsd + - windows + - linux + - darwin + goarch: + - amd64 + - "386" + - arm + - arm64 + ignore: + - goos: darwin + goarch: "386" + binary: "{{ .ProjectName }}_v{{ .Version }}" archives: -- format: zip - name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' + - format: zip + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" checksum: - name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + extra_files: + - glob: "terraform-registry-manifest.json" + name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json" + name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS" algorithm: sha256 signs: - artifacts: checksum @@ -50,6 +51,9 @@ signs: - "--detach-sign" - "${artifact}" release: + extra_files: + - glob: "terraform-registry-manifest.json" + name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json" # If you want to manually examine the release before its live, uncomment this line: # draft: true changelog: diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json new file mode 100644 index 0000000000..54250afd6c --- /dev/null +++ b/terraform-registry-manifest.json @@ -0,0 +1,8 @@ +{ + "version": 1, + "metadata": { + "protocol_versions": [ + "5.0" + ] + } +}