Skip to content

Commit 7994b58

Browse files
authored
automating maintenance with Github actions (#290)
* setup-go with go-version 1.17 * checkout submodules * remove explicit aws provider version
1 parent 56c58dd commit 7994b58

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

.github/workflows/maintenance.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
schedule:
5+
- cron: '*/5 * * * *'
6+
workflow_dispatch: # Enables on-demand/manual triggering
7+
jobs:
8+
job:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
submodules: true
14+
- uses: actions/setup-go@v2
15+
with:
16+
go-version: 1.17
17+
- run: |
18+
go get github.com/aws/aws-sdk-go
19+
go mod tidy
20+
go generate ./...
21+
cd tools/provider-schema
22+
terraform init -upgrade
23+
terraform providers schema -json > schema.json
24+
- uses: peter-evans/create-pull-request@v3
25+
with:
26+
commit-message: |
27+
autogenerated maintenance
28+
title: autogenerated maintenance
29+
delete-branch: true
30+
body: |
31+
If tests are stuck on https://github.com/peter-evans/create-pull-request/issues/48:
32+
["Manually close pull requests and immediately reopen them. This will enable `on: pull_request` workflows to run and be added as checks."](https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs)

tools/provider-schema/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ This `schema.json` file is used to get information against the terraform-provide
66

77
## Update schema file
88

9-
```console
10-
$ tfenv install
11-
# Edit provider.tf to update provider version
12-
$ terraform init -upgrade
13-
$ terraform providers schema -json > schema.json
9+
```sh
10+
tfenv install
11+
terraform init -upgrade
12+
terraform providers schema -json > schema.json
1413
```

tools/provider-schema/provider.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "3.70.0"
65
}
76
}
87
}

0 commit comments

Comments
 (0)