From cdea7e1719d44d6175c496afe99adae6f1e84c51 Mon Sep 17 00:00:00 2001 From: Vegard Hagen Date: Mon, 14 Jul 2025 14:45:50 +0200 Subject: [PATCH] fix(ci): use devcontainer image directly for tofu checks Signed-off-by: Vegard Hagen --- .devcontainer/devcontainer-build.json | 1 - .github/workflows/build-devcontainer.yaml | 4 ++-- .github/workflows/tofu-format.yaml | 29 ++++------------------- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/.devcontainer/devcontainer-build.json b/.devcontainer/devcontainer-build.json index a0c9752..08a8802 100644 --- a/.devcontainer/devcontainer-build.json +++ b/.devcontainer/devcontainer-build.json @@ -13,7 +13,6 @@ "username": "homelab" }, "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/go:1": {}, "ghcr.io/devcontainers/features/java:1": {}, "ghcr.io/devcontainers-extra/features/argo-cd:1": {}, "ghcr.io/devcontainers-extra/features/talosctl:1": {}, diff --git a/.github/workflows/build-devcontainer.yaml b/.github/workflows/build-devcontainer.yaml index 7154669..2c6ff53 100644 --- a/.github/workflows/build-devcontainer.yaml +++ b/.github/workflows/build-devcontainer.yaml @@ -3,9 +3,9 @@ name: Build devcontainer on: push: branches: [ main ] - paths: [ ".devcontainer/**" ] + paths: [ '.devcontainer/**' ] schedule: - - cron: "4 20 28 * *" + - cron: '4 20 28 * *' jobs: build: diff --git a/.github/workflows/tofu-format.yaml b/.github/workflows/tofu-format.yaml index dad38e6..4409098 100644 --- a/.github/workflows/tofu-format.yaml +++ b/.github/workflows/tofu-format.yaml @@ -2,7 +2,7 @@ name: OpenTofu validation on: push: - branches: [ '**' ] + branches: [ '**', '!renovate/**' ] paths: - '**.tf' - '**.tofu' @@ -13,17 +13,14 @@ on: pull_request_target: branches: [ main ] -permissions: - packages: write - jobs: - validate-tofu: + tofu-format: name: Validate runs-on: ubuntu-latest permissions: contents: read env: - TOFU_DIR: tofu/kubernetes + TOFU_DIR: tofu steps: - name: Checkout @@ -36,23 +33,7 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Tofu init - uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 #v0.3.1900000417 - with: - cacheFrom: ghcr.io/vehagn/homelab-devcontainer - push: never - runCmd: tofu -chdir=${{ env.TOFU_DIR }} init - - - name: Tofu validate - uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 #v0.3.1900000417 - with: - cacheFrom: ghcr.io/vehagn/homelab-devcontainer - push: never - runCmd: tofu -chdir=${{ env.TOFU_DIR }} validate - - name: Tofu format - uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 #v0.3.1900000417 + uses: docker://ghcr.io/vehagn/homelab-devcontainer with: - cacheFrom: ghcr.io/vehagn/homelab-devcontainer - push: never - runCmd: tofu -chdir=${{ env.TOFU_DIR }} fmt -recursive -diff -check + args: tofu -chdir=${{ env.TOFU_DIR }} fmt -recursive -diff -check