diff --git a/.github/workflows/test-tf.yml b/.github/workflows/test-tf.yml index e0841accc..cf96c0431 100644 --- a/.github/workflows/test-tf.yml +++ b/.github/workflows/test-tf.yml @@ -41,6 +41,7 @@ jobs: exit $result - name: Check HCL lock files are up to date + id: hcl-lock shell: bash run: | dirs=$( find . -type f -name "*.lock.hcl" -exec dirname "{}" \; | sort -ud) @@ -50,3 +51,12 @@ jobs: terraform -chdir="$dir" providers lock -platform=linux_arm64 -platform=linux_amd64 -platform=darwin_arm64 -platform=darwin_amd64 -platform=windows_amd64 done git diff --exit-code + + - name: Push changes on renovate + if: ${{ failure() && (steps.hcl-lock.conclusion == 'failure') && startsWith(github.head_ref, 'renovate/') }} + shell: bash + run: | + git config --global user.name "renovate[bot]" + git config --global user.email "29139614+renovate[bot]@users.noreply.github.com" + git commit -am "[bot] Update HCL lock files" + git push