From ad4982dbad7a249868140f2e7682f5fff7687c8b Mon Sep 17 00:00:00 2001 From: ShocOne <62835948+ShocOne@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:49:43 +0000 Subject: [PATCH 1/6] modified: .github/workflows/terraform-docs.yml --- .github/workflows/terraform-docs.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terraform-docs.yml b/.github/workflows/terraform-docs.yml index c8fe211..8c280bb 100644 --- a/.github/workflows/terraform-docs.yml +++ b/.github/workflows/terraform-docs.yml @@ -1,7 +1,7 @@ name: generate terraform docs on: - pull_request: + push: branches: - main paths-ignore: @@ -24,13 +24,14 @@ jobs: - uses: actions/checkout@v4.2.2 with: - ref: ${{ github.event.pull_request.head.ref }} + ref: main # Creates provider documentation for registry.terraform.io - name: Render terraform docs for microsoft365_graph uses: terraform-docs/gh-actions@v1.3.0 with: - working-dir: examples/ - find-dir: . + config-file: .terraform-docs.yml + find-dir: examples/ + recursive: true indention: 3 output-file: README.md output-method: inject From 52673ea4f91b914b6fd8092ea5c2e3b1852e506d Mon Sep 17 00:00:00 2001 From: ShocOne <62835948+ShocOne@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:50:30 +0000 Subject: [PATCH 2/6] Update terraform-docs workflow to trigger on push events and enhance documentation rendering configuration --- .github/workflows/terraform-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-docs.yml b/.github/workflows/terraform-docs.yml index 8c280bb..fb2fd9c 100644 --- a/.github/workflows/terraform-docs.yml +++ b/.github/workflows/terraform-docs.yml @@ -26,7 +26,7 @@ jobs: with: ref: main # Creates provider documentation for registry.terraform.io - - name: Render terraform docs for microsoft365_graph + - name: Render terraform docs for microsoft365 graph v1.0 + beta uses: terraform-docs/gh-actions@v1.3.0 with: config-file: .terraform-docs.yml From 4c4de9ad2dd2b46df4510389313c335abc8568e5 Mon Sep 17 00:00:00 2001 From: ShocOne <62835948+ShocOne@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:55:41 +0000 Subject: [PATCH 3/6] Update terraform-docs workflow to ignore pushes to main branch --- .github/workflows/terraform-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-docs.yml b/.github/workflows/terraform-docs.yml index fb2fd9c..1a53ead 100644 --- a/.github/workflows/terraform-docs.yml +++ b/.github/workflows/terraform-docs.yml @@ -2,7 +2,7 @@ name: generate terraform docs on: push: - branches: + branches-ignore: - main paths-ignore: - '.github/**/*' From e3732d6ccf57918d0ddc206cbda6816b883ff980 Mon Sep 17 00:00:00 2001 From: ShocOne <62835948+ShocOne@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:57:12 +0000 Subject: [PATCH 4/6] Rename MapRemoteStateToTerraform to mapRemoteStateToTerraform and add function documentation --- internal/resources/_resource_template/state.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/resources/_resource_template/state.go b/internal/resources/_resource_template/state.go index d78b7fa..ac8ae2a 100644 --- a/internal/resources/_resource_template/state.go +++ b/internal/resources/_resource_template/state.go @@ -9,7 +9,8 @@ import ( graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models" ) -func MapRemoteStateToTerraform(ctx context.Context, data *ResourceTemplateResourceModel, remoteResource graphmodels.DeviceAndAppManagementAssignmentFilterable) { +// mapRemoteStateToTerraform maps the remote state to the Terraform state +func mapRemoteStateToTerraform(ctx context.Context, data *ResourceTemplateResourceModel, remoteResource graphmodels.DeviceAndAppManagementAssignmentFilterable) { if remoteResource == nil { tflog.Debug(ctx, "Remote resource is nil") return From c0dbf5ccfa9cfc624a9c292c71e3b873b50a5a35 Mon Sep 17 00:00:00 2001 From: ShocOne <62835948+ShocOne@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:58:39 +0000 Subject: [PATCH 5/6] Disable recursive option in terraform-docs workflow configuration --- .github/workflows/terraform-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-docs.yml b/.github/workflows/terraform-docs.yml index 1a53ead..132a4cb 100644 --- a/.github/workflows/terraform-docs.yml +++ b/.github/workflows/terraform-docs.yml @@ -31,7 +31,7 @@ jobs: with: config-file: .terraform-docs.yml find-dir: examples/ - recursive: true + # recursive: true indention: 3 output-file: README.md output-method: inject From 756e3da1de7a016d547e446945799197339edc9c Mon Sep 17 00:00:00 2001 From: ShocOne <62835948+ShocOne@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:59:02 +0000 Subject: [PATCH 6/6] Update terraform-docs workflow to use dynamic reference for checkout --- .github/workflows/terraform-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-docs.yml b/.github/workflows/terraform-docs.yml index 132a4cb..c8370e5 100644 --- a/.github/workflows/terraform-docs.yml +++ b/.github/workflows/terraform-docs.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4.2.2 with: - ref: main + ref: ${{ github.ref }} # Creates provider documentation for registry.terraform.io - name: Render terraform docs for microsoft365 graph v1.0 + beta uses: terraform-docs/gh-actions@v1.3.0