Skip to content

Commit

Permalink
feat: update github-action version and added automerge file (#13)
Browse files Browse the repository at this point in the history
* feat: update github-action version and added automerge file

* feat: update github-action version and added automerge file

* feat: update github-action version and added automerge file

* feat: update github-action version and added automerge file

---------

Co-authored-by: anmolnagpal <anmol@clouddrove.com>
  • Loading branch information
theprashantyadav and anmolnagpal authored Jan 5, 2024
1 parent d7240b3 commit 060bfa1
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 144 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These owners will be the default owners for everything in the repo.
* @anmolnagpal @clouddrove/approvers @clouddrove-ci
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## what
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
* Use bullet points to be concise and to the point.

## why
* Provide the justifications for the changes (e.g. business case).
* Describe why these changes were made (e.g. why do these commits fix the problem?)
* Use bullet points to be concise and to the point.

## references
* Link to any supporting jira issues or helpful documentation to add some context (e.g. stackoverflow).
* Use `closes #123`, if this PR closes a Jira issue `#123`
14 changes: 14 additions & 0 deletions .github/workflows/auto_assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Assign PRs

on:
pull_request:
types: [opened, reopened]

workflow_dispatch:
jobs:
assignee:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.9
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
assignees: 'clouddrove-ci'
12 changes: 12 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Auto merge
on:
pull_request:
jobs:
auto-merge:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@1.0.9
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
tfcheck: '_example / Check code format'
...
4 changes: 2 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
jobs:
changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.9
secrets: inherit
with:
branch: 'master'
branch: 'master'
25 changes: 12 additions & 13 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.3.4
uses: actions/checkout@master

- name: Set up Python 3.7.
uses: actions/setup-python@v2
- name: 'Set up Python 3.7'
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v9.0.2'
uses: 'clouddrove/github-actions@9.0.3'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB}}'
github_token: '${{ secrets.GITHUB }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: pre-commit check errors
uses: pre-commit/action@v2.0.0
- name: 'pre-commit check errors'
uses: pre-commit/action@v3.0.0
continue-on-error: true

- name: pre-commit fix erros
uses: pre-commit/action@v2.0.0
- name: 'pre-commit fix erros'
uses: pre-commit/action@v3.0.0
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v9.0.2'
uses: 'clouddrove/github-actions@9.0.3'
continue-on-error: true
with:
actions_subcommand: 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/terraform.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: tf-checks
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
_example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9
with:
working_directory: './_example/'

11 changes: 11 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: tf-lint
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
tf-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.9
secrets:
GITHUB: ${{ secrets.GITHUB }}
2 changes: 1 addition & 1 deletion .github/workflows/tfsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
jobs:
tfsec:
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.9
secrets: inherit
with:
working_directory: '.'
25 changes: 25 additions & 0 deletions _example/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _example/versions.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Terraform version
terraform {
required_version = ">= 0.14.11"
required_version = ">= 1.6.5"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.1.15"
version = ">= 5.31.0"
}
}
}
35 changes: 0 additions & 35 deletions _test/vpcpeering_test.go

This file was deleted.

14 changes: 6 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,19 @@ data "aws_vpc" "requestor" {
#Module : ROUTE TABLE
#Description : Provides a resource to create a VPC routing table.
data "aws_route_table" "requestor" {
count = var.enable_peering == true ? length(distinct(sort(data.aws_subnet_ids.requestor[0].ids))) : 0
count = var.enable_peering == true ? length(distinct(sort(data.aws_subnets.requestor[0].ids))) : 0

subnet_id = element(
distinct(sort(data.aws_subnet_ids.requestor[0].ids)),
distinct(sort(data.aws_subnets.requestor[0].ids)),
count.index
)
}

#Module : SUBNET ID's
#Description : Lookup requestor subnets.
data "aws_subnet_ids" "requestor" {
data "aws_subnets" "requestor" {
count = var.enable_peering == true ? 1 : 0

vpc_id = data.aws_vpc.requestor[0].id
}

#Module : VPC ACCEPTOR
Expand All @@ -102,20 +101,19 @@ data "aws_vpc" "acceptor" {

#Module : SUBNET ID's ACCEPTOR
#Description : Lookup acceptor subnets.
data "aws_subnet_ids" "acceptor" {
data "aws_subnets" "acceptor" {
provider = "aws.accepter"
count = var.enable_peering == true ? 1 : 0
vpc_id = data.aws_vpc.acceptor[0].id
}

#Module : ROUTE TABLE
#Description : Lookup acceptor route tables.
data "aws_route_table" "acceptor" {
provider = "aws.accepter"
count = var.enable_peering == true ? length(distinct(sort(data.aws_subnet_ids.acceptor[0].ids))) : 0
count = var.enable_peering == true ? length(distinct(sort(data.aws_subnets.acceptor[0].ids))) : 0

subnet_id = element(
distinct(sort(data.aws_subnet_ids.acceptor[0].ids)),
distinct(sort(data.aws_subnets.acceptor[0].ids)),
count.index
)
}
Expand Down
11 changes: 11 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.6.5"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.31.0"
}
}
}

0 comments on commit 060bfa1

Please sign in to comment.