From 74b367744c7660a65b1d88319d84ef94ba46e50b Mon Sep 17 00:00:00 2001 From: Vishal Sharma Date: Thu, 5 Sep 2024 02:19:54 +0530 Subject: [PATCH] fix:renamed _examples to examples and referenced it --- .github/dependabot.yml | 8 +- .github/workflows/auto_assignee.yml | 14 ++++ .github/workflows/automerge.yml | 11 +++ .github/workflows/readme.yml | 59 +++----------- .github/workflows/semantic-releaser.yml | 30 -------- .github/workflows/static-checks.yml | 77 ------------------- .github/workflows/tf-checks.yml | 28 +++++++ .github/workflows/tflint.yml | 11 +++ .github/workflows/tfsec.yml | 14 ++-- {_example => examples}/basic/example.tf | 0 {_example => examples}/basic/outputs.tf | 0 {_example => examples}/complete/example.tf | 0 {_example => examples}/complete/outputs.tf | 0 .../firewall-with-isolated-rules/example.tf | 0 .../firewall-with-isolated-rules/outputs.tf | 0 .../firewall-with-public-ip-prefix/example.tf | 0 .../firewall-with-public-ip-prefix/outputs.tf | 0 17 files changed, 85 insertions(+), 167 deletions(-) create mode 100644 .github/workflows/auto_assignee.yml create mode 100644 .github/workflows/automerge.yml delete mode 100644 .github/workflows/semantic-releaser.yml delete mode 100644 .github/workflows/static-checks.yml create mode 100644 .github/workflows/tf-checks.yml create mode 100644 .github/workflows/tflint.yml rename {_example => examples}/basic/example.tf (100%) rename {_example => examples}/basic/outputs.tf (100%) rename {_example => examples}/complete/example.tf (100%) rename {_example => examples}/complete/outputs.tf (100%) rename {_example => examples}/firewall-with-isolated-rules/example.tf (100%) rename {_example => examples}/firewall-with-isolated-rules/outputs.tf (100%) rename {_example => examples}/firewall-with-public-ip-prefix/example.tf (100%) rename {_example => examples}/firewall-with-public-ip-prefix/outputs.tf (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 85359bb..f52a6af 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -30,7 +30,7 @@ updates: open-pull-requests-limit: 3 - package-ecosystem: "terraform" # See documentation for possible values - directory: "/_example/basic" # Location of package manifests + directory: "/examples/basic" # Location of package manifests schedule: interval: "weekly" # Add assignees @@ -43,7 +43,7 @@ updates: open-pull-requests-limit: 3 - package-ecosystem: "terraform" # See documentation for possible values - directory: "/_example/complete" # Location of package manifests + directory: "/examples/complete" # Location of package manifests schedule: interval: "weekly" # Add assignees @@ -56,7 +56,7 @@ updates: open-pull-requests-limit: 3 - package-ecosystem: "terraform" # See documentation for possible values - directory: "/_example/firewall-with-isolated-rules" # Location of package manifests + directory: "/examples/firewall-with-isolated-rules" # Location of package manifests schedule: interval: "weekly" # Add assignees @@ -69,7 +69,7 @@ updates: open-pull-requests-limit: 3 - package-ecosystem: "terraform" # See documentation for possible values - directory: "/_example/firewall-with-public-ip-prefix" # Location of package manifests + directory: "/examples/firewall-with-public-ip-prefix" # Location of package manifests schedule: interval: "weekly" # Add assignees diff --git a/.github/workflows/auto_assignee.yml b/.github/workflows/auto_assignee.yml new file mode 100644 index 0000000..2e6fff2 --- /dev/null +++ b/.github/workflows/auto_assignee.yml @@ -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.2.8 + secrets: + GITHUB: ${{ secrets.GITHUB }} + with: + assignees: 'clouddrove-ci' \ No newline at end of file diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..24efebe --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,11 @@ +--- + name: Auto merge + on: + pull_request: + jobs: + auto-merge: + uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@1.2.8 + secrets: + GITHUB: ${{ secrets.GITHUB }} + with: + tfcheck: 'basic-example / Check code format' \ No newline at end of file diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index 03b477f..444164d 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -1,54 +1,15 @@ -name: 'Create README.md file' +name: Readme Workflow on: push: branches: - master - + paths-ignore: + - 'README.md' + - 'docs/**' + workflow_dispatch: jobs: - readme-create: - name: 'readme-create' - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@master - - - name: 'Set up Python 3.7' - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: 'create readme' - uses: 'clouddrove/github-actions@9.0.3' - with: - actions_subcommand: 'readme' - github_token: '${{ secrets.GITHUB }}' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - - 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@v3.0.0 - continue-on-error: true - - - name: 'push readme' - uses: 'clouddrove/github-actions@9.0.3' - continue-on-error: true - with: - actions_subcommand: 'push' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Slack Notification' - uses: clouddrove/action-slack@v2 - with: - status: ${{ job.status }} - fields: repo,author - author_name: 'CloudDrove' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required - if: always() \ No newline at end of file + README: + uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@master + secrets: + TOKEN : ${{ secrets.GITHUB }} + SLACK_WEBHOOK_TERRAFORM: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} \ No newline at end of file diff --git a/.github/workflows/semantic-releaser.yml b/.github/workflows/semantic-releaser.yml deleted file mode 100644 index c6911b9..0000000 --- a/.github/workflows/semantic-releaser.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release - -on: - push: - branches: - - main - paths: - - '**.tf' - - '!_example/**.tf' - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 14 - - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - run: npx semantic-release diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml deleted file mode 100644 index 7bf6ae8..0000000 --- a/.github/workflows/static-checks.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: static-checks - -on: - pull_request: - -jobs: - versionExtract: - name: Get min/max versions - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Terraform min/max versions - id: minMax - uses: clowdhaus/terraform-min-max@main - outputs: - minVersion: ${{ steps.minMax.outputs.minVersion }} - maxVersion: ${{ steps.minMax.outputs.maxVersion }} - - versionEvaluate: - name: Evaluate Terraform versions - runs-on: ubuntu-latest - needs: versionExtract - strategy: - fail-fast: false - matrix: - version: - - ${{ needs.versionExtract.outputs.minVersion }} - - ${{ needs.versionExtract.outputs.maxVersion }} - directory: - - _example/basic/ - - _example/complete/ - - _example/firewall-with-isolated-rules/ - - _example/firewall-with-public-ip-prefix/ - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Terraform v${{ matrix.version }} - uses: hashicorp/setup-terraform@v3 - with: - terraform_version: ${{ matrix.version }} - - - name: Init & validate v${{ matrix.version }} - run: | - cd ${{ matrix.directory }} - terraform init - terraform validate - - name: tflint - uses: reviewdog/action-tflint@master - with: - tflint_version: v0.29.0 - github_token: ${{ secrets.GITHUB_TOKEN }} - working_directory: ${{ matrix.directory }} - fail_on_error: 'true' - filter_mode: 'nofilter' - flags: '--module' - - format: - name: Check code format - runs-on: ubuntu-latest - needs: versionExtract - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Terraform v${{ needs.versionExtract.outputs.maxVersion }} - uses: hashicorp/setup-terraform@v3 - with: - terraform_version: ${{ needs.versionExtract.outputs.maxVersion }} - - - name: Check Terraform format changes - run: terraform fmt --recursive -check=true \ No newline at end of file diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml new file mode 100644 index 0000000..335292d --- /dev/null +++ b/.github/workflows/tf-checks.yml @@ -0,0 +1,28 @@ + +name: tf-checks +on: + push: + branches: [ master ] + pull_request: + workflow_dispatch: +jobs: + basic-example: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.8 + with: + working_directory: './examples/basic/' + + complete-example: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.8 + with: + working_directory: './examples/complete/' + + firewall-with-isolated-rules: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.8 + with: + working_directory: './examples/firewall-with-isolated-rules/' + + firewall-with-public-ip-prefix: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.8 + with: + working_directory: './examples/firewall-with-public-ip-prefix/' + diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml new file mode 100644 index 0000000..0badffd --- /dev/null +++ b/.github/workflows/tflint.yml @@ -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.2.8 + secrets: + GITHUB: ${{ secrets.GITHUB }} \ No newline at end of file diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index 9aaf588..0badffd 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -1,11 +1,11 @@ -name: tfsec -permissions: write-all +name: tf-lint on: + push: + branches: [ master ] pull_request: workflow_dispatch: jobs: - tfsec: - uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master - secrets: inherit - with: - working_directory: '.' \ No newline at end of file + tf-lint: + uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.2.8 + secrets: + GITHUB: ${{ secrets.GITHUB }} \ No newline at end of file diff --git a/_example/basic/example.tf b/examples/basic/example.tf similarity index 100% rename from _example/basic/example.tf rename to examples/basic/example.tf diff --git a/_example/basic/outputs.tf b/examples/basic/outputs.tf similarity index 100% rename from _example/basic/outputs.tf rename to examples/basic/outputs.tf diff --git a/_example/complete/example.tf b/examples/complete/example.tf similarity index 100% rename from _example/complete/example.tf rename to examples/complete/example.tf diff --git a/_example/complete/outputs.tf b/examples/complete/outputs.tf similarity index 100% rename from _example/complete/outputs.tf rename to examples/complete/outputs.tf diff --git a/_example/firewall-with-isolated-rules/example.tf b/examples/firewall-with-isolated-rules/example.tf similarity index 100% rename from _example/firewall-with-isolated-rules/example.tf rename to examples/firewall-with-isolated-rules/example.tf diff --git a/_example/firewall-with-isolated-rules/outputs.tf b/examples/firewall-with-isolated-rules/outputs.tf similarity index 100% rename from _example/firewall-with-isolated-rules/outputs.tf rename to examples/firewall-with-isolated-rules/outputs.tf diff --git a/_example/firewall-with-public-ip-prefix/example.tf b/examples/firewall-with-public-ip-prefix/example.tf similarity index 100% rename from _example/firewall-with-public-ip-prefix/example.tf rename to examples/firewall-with-public-ip-prefix/example.tf diff --git a/_example/firewall-with-public-ip-prefix/outputs.tf b/examples/firewall-with-public-ip-prefix/outputs.tf similarity index 100% rename from _example/firewall-with-public-ip-prefix/outputs.tf rename to examples/firewall-with-public-ip-prefix/outputs.tf