-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (72 loc) · 2.67 KB
/
Copy pathterraform-modules.yml
File metadata and controls
88 lines (72 loc) · 2.67 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Terraform module catalogue
on:
pull_request:
paths:
- ".github/workflows/terraform-modules.yml"
- "scripts/sync-terraform-modules.py"
- "terraform-modules/**"
push:
branches:
- main
paths:
- ".github/workflows/terraform-modules.yml"
- "scripts/sync-terraform-modules.py"
- "terraform-modules/**"
schedule:
- cron: "17 7 * * 1"
workflow_dispatch:
inputs:
reason:
description: "Why is this catalogue refresh being run?"
required: false
default: "Manual Terraform module catalogue refresh"
type: string
concurrency:
group: terraform-module-catalogue-update
cancel-in-progress: false
permissions:
contents: read
jobs:
verify:
if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Install JSON Schema validator
run: python3 -m pip install --disable-pip-version-check check-jsonschema==0.38.0
- name: Validate catalogue schema
run: check-jsonschema --schemafile terraform-modules/modules.schema.json terraform-modules/modules.json
- name: Check Registry, GitHub, and generated catalogue
env:
GITHUB_TOKEN: ${{ github.token }}
run: python3 scripts/sync-terraform-modules.py --check
update:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Install JSON Schema validator
run: python3 -m pip install --disable-pip-version-check check-jsonschema==0.38.0
- name: Refresh Registry and GitHub metadata
env:
GITHUB_TOKEN: ${{ github.token }}
run: python3 scripts/sync-terraform-modules.py --write
- name: Validate refreshed catalogue
run: check-jsonschema --schemafile terraform-modules/modules.schema.json terraform-modules/modules.json
- name: Open catalogue update pull request
uses: peter-evans/create-pull-request@v8
with:
branch: automation/terraform-module-catalogue
delete-branch: true
commit-message: update terraform module catalogue
title: Update Terraform module catalogue
body: |
Terraform module catalogue refresh.
Trigger: `${{ github.event_name }}`
Reason: ${{ inputs.reason || 'Scheduled weekly refresh' }}
The generated module configuration, cards, and structured data are included in this pull request.