Skip to content

Commit 9a74a97

Browse files
Initial commit
0 parents  commit 9a74a97

23 files changed

+857
-0
lines changed

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "terraform"
4+
directories:
5+
- "/"
6+
- "/examples/"
7+
schedule:
8+
interval: "weekly"
9+
commit-message:
10+
prefix: "terraform provider updates available: "
11+
open-pull-requests-limit: 5
12+
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"
17+
commit-message:
18+
prefix: "github actions updates available: "
19+
open-pull-requests-limit: 5
20+
21+
- package-ecosystem: "gomod"
22+
directory: "test/"
23+
schedule:
24+
interval: "weekly"
25+
commit-message:
26+
prefix: "go module updates available: "
27+
open-pull-requests-limit: 5

.github/lint/.tflint.hcl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/config.md
2+
3+
tflint {
4+
required_version = ">= 0.50"
5+
}
6+
7+
plugin "terraform" {
8+
enabled = true
9+
preset = "recommended"
10+
}
11+
// for microsoft azure
12+
plugin "azurerm" {
13+
enabled = true
14+
version = "0.29.0"
15+
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
16+
}

.github/settings.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
2+
3+
repository:
4+
5+
# A comma-separated list of topics to set on the repository
6+
topics: terraform, terraform-module, azure
7+
8+
# Either `true` to make the repository private, or `false` to make it public.
9+
private: true
10+
11+
# Either `true` to enable issues for this repository, `false` to disable them.
12+
has_issues: true
13+
14+
# Either `true` to enable projects for this repository, or `false` to disable them.
15+
# If projects are disabled for the organization, passing `true` will cause an API error.
16+
has_projects: true
17+
18+
# Either `true` to enable the wiki for this repository, `false` to disable it.
19+
has_wiki: false
20+
21+
# Either `true` to enable downloads for this repository, `false` to disable them.
22+
has_downloads: false
23+
24+
# Updates the default branch for this repository.
25+
default_branch: main
26+
27+
# Either `true` to allow squash-merging pull requests, or `false` to prevent
28+
# squash-merging.
29+
allow_squash_merge: true
30+
31+
# Either `true` to allow merging pull requests with a merge commit, or `false`
32+
# to prevent merging pull requests with merge commits.
33+
allow_merge_commit: true
34+
35+
# Either `true` to allow rebase-merging pull requests, or `false` to prevent
36+
# rebase-merging.
37+
allow_rebase_merge: true
38+
39+
# Either `true` to enable automatic deletion of branches on merge, or `false` to disable
40+
delete_branch_on_merge: true
41+
42+
# Either `true` to enable automated security fixes, or `false` to disable
43+
# automated security fixes.
44+
enable_automated_security_fixes: true
45+
46+
# Either `true` to enable vulnerability alerts, or `false` to disable
47+
# vulnerability alerts.
48+
enable_vulnerability_alerts: true
49+
50+
# Labels: define labels for Issues and Pull Requests
51+
labels:
52+
- name: bug
53+
color: CC0000
54+
description: An issue with the system 🐛.
55+
56+
- name: terraform
57+
color: "#006b75"
58+
description: An issue related to terraform.
59+
60+
- name: azure
61+
color: "#007fff"
62+
description: An issue related to Azure.
63+
64+
- name: aws
65+
color: "#ff9900"
66+
description: An issue related to AWS.
67+
68+
- name: go
69+
color: "#e99695"
70+
description: An issue related to Go.
71+
72+
- name: feature
73+
# If including a `#`, make sure to wrap it with quotes!
74+
color: '#336699'
75+
description: New functionality.
76+
77+
- name: do-not-merge
78+
color: "#bfdadc"
79+
description: Probelmatic PR.
80+
81+
- name: actions
82+
color: "#2088ff"
83+
description: An issue related to GitHub Actions.
84+
85+
- name: patch
86+
color: 0e8a16
87+
description: A bug fix or patch.
88+
89+
- name: minor
90+
color: d4c5f9
91+
description: A minor change or improvement.
92+
93+
- name: major
94+
color: ffa198
95+
description: A major change that might break backward compatibility.
96+
97+
- name: first-release
98+
color: "#5f4449"
99+
description: The first release of this project.
100+
101+
# See https://docs.github.com/en/rest/reference/teams#add-or-update-team-repository-permissions for available options
102+
teams:
103+
- name: terraform-reviewers
104+
# The permission to grant the team. Can be one of:
105+
# * `pull` - can pull, but not push to or administer this repository.
106+
# * `push` - can pull and push, but not administer this repository.
107+
# * `admin` - can pull, push and administer this repository.
108+
# * `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.
109+
# * `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access.
110+
permission: admin
111+
112+
branches:
113+
- name: main
114+
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
115+
# Branch Protection settings. Set to null to disable
116+
protection:
117+
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
118+
required_pull_request_reviews:
119+
# The number of approvals required. (1-6)
120+
required_approving_review_count: 1
121+
# Dismiss approved reviews automatically when a new commit is pushed.
122+
dismiss_stale_reviews: true
123+
# Blocks merge until code owners have reviewed.
124+
require_code_owner_reviews: true
125+
# Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories.
126+
dismissal_restrictions:
127+
users: []
128+
teams: []
129+
# Prevent merge commits from being pushed to matching branches
130+
required_linear_history: false
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: auto-fill-readme
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
10+
jobs:
11+
setup-env:
12+
name: Setup environment variables
13+
runs-on: ubuntu-latest
14+
outputs:
15+
repo_name: ${{ steps.extract.outputs.repo_name }}
16+
org_name: ${{ steps.extract.outputs.org_name }}
17+
18+
steps:
19+
- name: Extract repository details
20+
id: extract
21+
run: |
22+
echo "repo_name=${GITHUB_REPOSITORY#*/}" >> $GITHUB_OUTPUT
23+
echo "org_name=${GITHUB_REPOSITORY%/*}" >> $GITHUB_OUTPUT
24+
25+
replace-placeholders:
26+
name: Replace placeholders and commit changes
27+
runs-on: ubuntu-latest
28+
needs: setup-env # sequential execution
29+
permissions:
30+
contents: write
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Set up environment variables
37+
env:
38+
REPO_NAME: ${{ needs.setup-env.outputs.repo_name }}
39+
ORG_NAME: ${{ needs.setup-env.outputs.org_name }}
40+
run: |
41+
echo "Using repo: ${REPO_NAME}"
42+
echo "Using org: ${ORG_NAME}"
43+
echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV
44+
echo "ORG_NAME=${ORG_NAME}" >> $GITHUB_ENV
45+
46+
- name: Replace placeholders in all README.md files
47+
run: |
48+
echo "Replacing placeholders in all README.md files..."
49+
find . -type f -iname "README.md" -print0 | while IFS= read -r -d '' file; do
50+
echo "Processing $file"
51+
sed -i "s|{REPO_NAME}|${REPO_NAME}|g" "$file"
52+
sed -i "s|{ORG_NAME}|${ORG_NAME}|g" "$file"
53+
done
54+
55+
- name: Show diff for verification
56+
run: |
57+
echo "Checking for changes..."
58+
git status
59+
git diff -- README.md || true
60+
61+
- name: Commit and push changes
62+
run: |
63+
if [[ -n "$(git status --porcelain)" ]]; then
64+
echo "Changes detected. Committing..."
65+
git config user.name "github-actions[bot]"
66+
git config user.email "github-actions[bot]@users.noreply.github.com"
67+
git add .
68+
git commit -m "chore: auto-fill README placeholders"
69+
git push
70+
else
71+
echo "No changes detected, skipping commit."
72+
fi

.github/workflows/go.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: go
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v5
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.21.5'
23+
24+
- name: Setup Terraform
25+
uses: hashicorp/setup-terraform@v3
26+
27+
- name: Install dependencies
28+
run: |
29+
cd test
30+
go mod tidy
31+
32+
- name: Run tests
33+
env:
34+
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
35+
ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
36+
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
37+
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
38+
run: |
39+
cd test
40+
go test -v -timeout 30m

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: create-release
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: write
12+
13+
run-name: create release from pr number ${{ github.event.number }}
14+
jobs:
15+
create-release:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
20+
- name: Token generator
21+
uses: githubofkrishnadhas/github-access-using-githubapp@v2
22+
id: token-generation
23+
with:
24+
github_app_id: ${{ secrets.TOKEN_GENERATOR_APPID }}
25+
github_app_private_key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }}
26+
27+
- name: Checkout Repository
28+
uses: actions/checkout@v5
29+
with:
30+
token: ${{ steps.token-generation.outputs.token }}
31+
32+
- name: create-release
33+
uses: devwithkrishna/[email protected]
34+
with:
35+
token: ${{ steps.token-generation.outputs.token }}
36+
pr_number: ${{ github.event.number }}
37+
generate_release_notes: true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: terraform-lint
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
7+
8+
jobs:
9+
tflint:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout source code
14+
uses: actions/checkout@v5
15+
16+
- uses: terraform-linters/setup-tflint@v6
17+
name: Setup tflint
18+
with:
19+
tflint_version: v0.52.0
20+
cache: true
21+
22+
- name: Show version
23+
run: tflint --version
24+
25+
- name: Init tflint
26+
run: tflint --init
27+
env:
28+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
29+
GITHUB_TOKEN: ${{ github.token }}
30+
31+
- name: Run tflint
32+
run: tflint -f compact

0 commit comments

Comments
 (0)