From 9cdebcfa5a4832754bd8d0a73968bbb0c97b1298 Mon Sep 17 00:00:00 2001 From: Sarah Chavis <62406755+schavis@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:03:58 -0700 Subject: [PATCH 1/2] Add action to label content PRs --- .github/labeler.yml | 91 +++++++++++++++++++++++++ .github/workflows/label-content-prs.yml | 21 ++++++ 2 files changed, 112 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/label-content-prs.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..1f2b99949c --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,91 @@ +# Add a Terraform label to changes under the related folders: +# +# Folder | Labels +# --------------------------- | ------------------------------------------------ +# terraform | Terraform CE +# terraform-cdk | None +# terraform-docs-agents | Terraform agents +# terraform-docs-common | HCP Terraform +# terraform-enterprise | Terraform Enterprise +# terraform-migrate | Terraform migrate +# terraform-plugin-framework | TF Plugin Framework +# terraform-plugin-log | None +# terraform-plugin-mux | None +# terraform-plugin-sdk | None +# terraform-plugin-testing | None + +Terraform CE: +- any: + - changed-files: + - any-glob-to-any-file: [ + 'content/terraform/**' + ] + +Terraform agents: +- any: + - changed-files: + - any-glob-to-any-file: [ + 'content/terraform/**' + ] + +HCP Terraform: +- any: + - changed-files: + - any-glob-to-any-file: [ + 'content/terraform/**' + ] + +Terraform Enterprise: +- any: + - changed-files: + - any-glob-to-any-file: [ + 'content/terraform-enterprise/**' + ] + +Terraform migrate: +- any: + - changed-files: + - any-glob-to-any-file: [ + 'content/terraform-docs-common/**' + ] + +TF Plugin Framework: +- any: + - changed-files: + - any-glob-to-any-file: [ + 'content/terraform-plugin-framework/**' + ] + + +# Add 'Vault' label to changes under 'content/vault' +# +# Label | Rule +# --------------- | ------------------------------------------------------------ +# Vault | Default; applies to all doc updates +# Vault IC update | Updates on "Important changes" related docs + +Vault: +- any: + - changed-files: + - any-glob-to-any-file: ['content/vault/**'] + +Vault IC: +- any: + - changed-files: + - any-glob-to-any-file: [ + 'content/vault/global/partials/important-changes/**', + 'content/vault/*/content/docs/updates/change-tracker.mdx', + 'content/vault/*/content/docs/updates/important-changes.mdx', + 'content/vault/*/content/docs/updates/lts-tracker.mdx' + ] + +# Add 'WAF' label to changes under 'content/well-architected-framework' +# +# Label | Rule +# --------------- | ------------------------------------------------------------ +# WAF | Default; applies to all doc updates + +WAF: +- any: + - changed-files: + - any-glob-to-any-file: ['well-architected-framework/**'] \ No newline at end of file diff --git a/.github/workflows/label-content-prs.yml b/.github/workflows/label-content-prs.yml new file mode 100644 index 0000000000..c2561da042 --- /dev/null +++ b/.github/workflows/label-content-prs.yml @@ -0,0 +1,21 @@ +# Apply a product label based on the content files modified in the pull request +# and configuration details in .github/labeler.yml. +# +# For more information, see: https://github.com/actions/labeler + +name: 🏷️ Label content PRs + +on: [pull_request_target] + +jobs: + + label-the-pr: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + sync-labels: true \ No newline at end of file From 976872948bcab83c8408083b8505fd276aed9f37 Mon Sep 17 00:00:00 2001 From: Sarah Chavis <62406755+schavis@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:35:57 -0700 Subject: [PATCH 2/2] fix copy/paste errors --- .github/labeler.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 1f2b99949c..970336ee4b 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -25,14 +25,14 @@ Terraform agents: - any: - changed-files: - any-glob-to-any-file: [ - 'content/terraform/**' + 'content/terraform-docs-agents/**' ] HCP Terraform: - any: - changed-files: - any-glob-to-any-file: [ - 'content/terraform/**' + 'content/terraform-docs-common/**' ] Terraform Enterprise: @@ -46,7 +46,7 @@ Terraform migrate: - any: - changed-files: - any-glob-to-any-file: [ - 'content/terraform-docs-common/**' + 'content/terraform-migrate/**' ] TF Plugin Framework: