From 042a70162bac10e5503496ee9c639ea6286eaa67 Mon Sep 17 00:00:00 2001 From: Somtochi Onyekwere Date: Thu, 12 Oct 2023 15:40:10 +0100 Subject: [PATCH 1/2] add ci workflow for checking tf files Signed-off-by: Somtochi Onyekwere --- .github/workflows/check.yaml | 23 +++++++++++++++++++++++ Makefile | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/check.yaml create mode 100644 Makefile diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..c790982 --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,23 @@ +name: check + +on: + pull_request: + push: + branches: + - main + +jobs: + terraform-fmt: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - name: Setup Terraform + uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2 + with: + terraform_version: latest + terraform_wrapper: false + - name: Check tf files + run: | + # run check formatting of files in tf-modules directory + make tf-fmt TF_ARGS="-check -diff" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cd2c53d --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +TF_ARGS= + +tf-fmt: + terraform fmt -recursive $(TF_ARGS) tf-modules From 0d4c93644ad3f231a2ff7c4b2d8b3448869677bd Mon Sep 17 00:00:00 2001 From: Somtochi Onyekwere Date: Fri, 13 Oct 2023 13:35:04 +0100 Subject: [PATCH 2/2] add labels and dependabot ci Signed-off-by: Somtochi Onyekwere --- .github/dependabot.yaml | 16 ++++++++++++++++ .github/labels.yaml | 9 +++++++++ .github/workflows/sync-labels.yaml | 28 ++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .github/dependabot.yaml create mode 100644 .github/labels.yaml create mode 100644 .github/workflows/sync-labels.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..e07776c --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,16 @@ +version: 2 + +updates: + - package-ecosystem: "github-actions" + directory: "/" + labels: ["area/ci", "dependencies"] + groups: + # Group all updates together, so that they are all applied in a single PR. + # Grouped updates are currently in beta and is subject to change. + # xref: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups + ci: + patterns: + - "*" + schedule: + # By default, this will be on a monday. + interval: "weekly" diff --git a/.github/labels.yaml b/.github/labels.yaml new file mode 100644 index 0000000..a757548 --- /dev/null +++ b/.github/labels.yaml @@ -0,0 +1,9 @@ +# Configuration file to declaratively configure labels +# Ref: https://github.com/EndBug/label-sync#Config-files + +- name: area/terraform + description: Terraform related issues and pull requests + color: '#00b140' +- name: area/tftestenv + description: Tftestenv package related issues and pull requests + color: '#863faf' diff --git a/.github/workflows/sync-labels.yaml b/.github/workflows/sync-labels.yaml new file mode 100644 index 0000000..6396954 --- /dev/null +++ b/.github/workflows/sync-labels.yaml @@ -0,0 +1,28 @@ +name: sync-labels +on: + workflow_dispatch: + push: + branches: + - main + paths: + - .github/labels.yaml + +permissions: + contents: read + +jobs: + labels: + name: Run sync + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: EndBug/label-sync@da00f2c11fdb78e4fae44adac2fdd713778ea3e8 # v2.3.2 + with: + # Configuration file + config-file: | + https://raw.githubusercontent.com/fluxcd/community/main/.github/standard-labels.yaml + .github/labels.yaml + # Strictly declarative + delete-other-labels: true