Skip to content

Commit d5bb8ff

Browse files
authored
Merge pull request #19 from telekom-mms/refactoring
Refactoring
2 parents 2157ac3 + b82c0d4 commit d5bb8ff

24 files changed

+786
-641
lines changed

.github/release-drafter.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"repos": {
3+
"description": "A Terraform module that manages the container resources from the azurerm provider.",
4+
"visibility": "public",
5+
"default_branch": "main",
6+
"homepage": "https://telekom-mms.github.io/terraform-template",
7+
"topics": [
8+
"terraform",
9+
"azure",
10+
"azurerm-dns-zone",
11+
"azurerm-private-dns-zone",
12+
"azurerm-dns-a-record",
13+
"azurerm-dns-cname-record",
14+
"azurerm-dns-txt-record",
15+
"azurerm-dns-mx-record"
16+
]
17+
}
18+
}

.github/workflows/codespell.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: codespell
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
call-codespell:
12+
uses: telekom-mms/.github/.github/workflows/codespell.yml@main

.github/workflows/linting.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: linting
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
call-linting:
12+
uses: telekom-mms/.github/.github/workflows/terraform_linting.yml@main

.github/workflows/prettier-md.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 14 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,19 @@
11
---
2-
name: New release
2+
name: release
33

4-
on: # yamllint disable-line rule:truthy
5-
workflow_dispatch:
4+
on:
65
push:
7-
branches:
8-
- main
6+
branches: [main]
97

10-
jobs:
11-
generate_changelog:
12-
runs-on: ubuntu-latest
13-
name: create release draft
14-
steps:
15-
- uses: actions/checkout@v3.2.0
16-
with:
17-
fetch-depth: 0
18-
19-
- name: 'Get Previous tag'
20-
id: previoustag
21-
uses: "WyriHaximus/github-action-get-previous-tag@master"
22-
env:
23-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
24-
25-
- name: calculate next version
26-
id: version
27-
uses: patrickjahns/version-drafter-action@v1
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
31-
- name: Generate changelog
32-
uses: charmixer/auto-changelog-action@v1
33-
with:
34-
token: ${{ secrets.GITHUB_TOKEN }}
35-
future_release: ${{ steps.version.outputs.next-version }}
36-
37-
- name: Generate readme
38-
uses: terraform-docs/gh-actions@main
39-
with:
40-
working-dir: .
41-
output-file: README.md
42-
output-method: inject
8+
env:
9+
TEMPLATE_REPOSITORY: telekom-mms/terraform-template
4310

44-
- name: push changelog and readme
45-
uses: github-actions-x/commit@v2.9
46-
with:
47-
github-token: ${{ secrets.GITHUB_TOKEN }}
48-
push-branch: 'main'
49-
commit-message: 'update changelog'
50-
force-add: 'true'
51-
files: CHANGELOG.md README.md
52-
name: T-Systems MMS
53-
email: frage@t-systems-mms.com
54-
55-
# do a second checkout to prevent race situation
56-
# changelog gets updated but action works on old commit id
57-
- uses: actions/checkout@v3.2.0
58-
with:
59-
ref: main
60-
61-
- name: Generate changelog for the release
62-
run: |
63-
sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md
64-
- name: Read CHANGELOG.md
65-
id: package
66-
uses: juliangruber/read-file-action@v1
67-
with:
68-
path: ./CHANGELOGRELEASE.md
69-
70-
- name: Create Release draft
71-
id: create_release
72-
uses: actions/create-release@v1
73-
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
75-
with:
76-
release_name: ${{ steps.version.outputs.next-version }}
77-
tag_name: ${{ steps.version.outputs.next-version }}
78-
body: |
79-
${{ steps.package.outputs.content }}
80-
draft: true
11+
jobs:
12+
call-readme:
13+
if: github.repository != '$TEMPLATE_REPOSITORY'
14+
uses: telekom-mms/.github/.github/workflows/terraform_docs.yml@main
15+
call-release:
16+
if: github.repository != '$TEMPLATE_REPOSITORY'
17+
uses: telekom-mms/.github/.github/workflows/release.yml@main
18+
with:
19+
files: README.md

.github/workflows/settings.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: settings
3+
4+
on:
5+
push:
6+
branches: [main]
7+
schedule:
8+
- cron: '0 10 * * *'
9+
10+
env:
11+
TEMPLATE_REPOSITORY: telekom-mms/terraform-template
12+
13+
jobs:
14+
call-settings:
15+
if: github.repository != '$TEMPLATE_REPOSITORY'
16+
uses: telekom-mms/.github/.github/workflows/github_repository.yml@main
17+
secrets:
18+
GH_APP_CREDENTIALS_TOKEN: ${{ secrets.GH_APP_CREDENTIALS_TOKEN }}

.github/workflows/terraform.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/terrascan.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: terrascan
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
env:
9+
TEMPLATE_REPOSITORY: telekom-mms/terraform-template
10+
11+
jobs:
12+
call-terrascan:
13+
if: github.repository != '$TEMPLATE_REPOSITORY'
14+
uses: telekom-mms/.github/.github/workflows/terrascan.yml@main
15+
with:
16+
iac_type: terraform
17+
policy_type: all
18+
non_recursive: true

.github/workflows/terratest.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: terratest
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
env:
9+
TEMPLATE_REPOSITORY: telekom-mms/terraform-template
10+
11+
jobs:
12+
call-terratest:
13+
if: github.repository != '$TEMPLATE_REPOSITORY'
14+
uses: telekom-mms/.github/.github/workflows/terratest.yml@main
15+
with:
16+
test: azure
17+
secrets:
18+
azure_client_id: ${{ secrets.AZURE_CLIENT_ID }}
19+
azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }}
20+
azure_subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
21+
azure_tenant_id: ${{ secrets.AZURE_TENANT_ID }}

0 commit comments

Comments
 (0)