-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 2.08 KB
/
terraform-providers-upgrade.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "Terraform Providers Upgrade"
on:
workflow_dispatch:
jobs:
terraform-providers-upgrade:
name: "Terraform Providers Upgrade"
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Configure Terraform Provider Plugin Cache
run: |
plugin_cache_dir="$HOME/.terraform.d/plugin-cache"
printf 'plugin_cache_dir="%s"' "${plugin_cache_dir}" > ~/.terraformrc
mkdir --parents "${plugin_cache_dir}"
- name: Cache Terraform
uses: actions/cache@v4
with:
path: |
~/.terraform.d/plugin-cache
key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }}
restore-keys: |
${{ runner.os }}-terraform-
- name: Terraform Upgrade
id: upgrade
run: |
terraform init -no-color -upgrade -backend=false
terraform providers lock -platform=windows_amd64 -platform=linux_amd64 -platform=darwin_amd64
- name: Update Terraform docs
uses: terraform-docs/gh-actions@v1
with:
working-dir: .
config-file: .terraform-docs.yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GH_TOKEN_REPO_SCOPED }}
title: "deps: Upgrade terraform providers"
body: |
Automated changes create by [Workflow Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
commit-message: "deps: Upgrade terraform providers"
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
labels: |
dependencies
terraform
add-paths: .terraform.lock.hcl
base: main
branch: terraform-providers-upgrade
delete-branch: true