Skip to content

Commit

Permalink
add validate-codeowners
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru committed Dec 10, 2020
1 parent b6362e0 commit 167c78a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: "Handle common commands"
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -24,7 +24,7 @@ jobs:
- name: "Checkout commit"
uses: actions/checkout@v2
- name: "Run tests"
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Validate Codeowners
on:
pull_request:
paths:
- '**/CODEOWNERS'
- '.github/workflows/validate-codeowners.yml'

jobs:
validate-codeowners:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
- uses: mszostok/[email protected]
with:
checks: "files,syntax,owners,duppatterns"
# GitHub access token is required only if the `owners` check is enabled
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,9 @@ Available targets:
terraform/get-plugins Ensure all plugins can be fetched
terraform/install Install terraform
terraform/lint Lint check Terraform
terraform/remove-upper-bound Rewrite versions.tf to remove upper bound for terraform core version constraint (like this ">= 0.12.0, < 0.14.0")
terraform/rewrite-module-source Rewrite the *.tf files to use registry notation for modules sources
terraform/loosen-constraints and convert "~>" constraints to ">=".
terraform/rewrite-required-providers Rewrite versions.tf to update existing configuration to add an explicit source attribute for each provider
terraform/upgrade-modules Upgrade all terraform module sources
terraform/upgrade-modules This target has not been upgraded to handle registry format
terraform/validate Basic terraform sanity check
travis/docker-login Login into docker hub
travis/docker-tag-and-push Tag & Push according Travis environment variables
Expand Down
5 changes: 2 additions & 3 deletions docs/targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ Available targets:
terraform/get-plugins Ensure all plugins can be fetched
terraform/install Install terraform
terraform/lint Lint check Terraform
terraform/remove-upper-bound Rewrite versions.tf to remove upper bound for terraform core version constraint (like this ">= 0.12.0, < 0.14.0")
terraform/rewrite-module-source Rewrite the *.tf files to use registry notation for modules sources
terraform/loosen-constraints and convert "~>" constraints to ">=".
terraform/rewrite-required-providers Rewrite versions.tf to update existing configuration to add an explicit source attribute for each provider
terraform/upgrade-modules Upgrade all terraform module sources
terraform/upgrade-modules This target has not been upgraded to handle registry format
terraform/validate Basic terraform sanity check
travis/docker-login Login into docker hub
travis/docker-tag-and-push Tag & Push according Travis environment variables
Expand Down
5 changes: 4 additions & 1 deletion templates/.github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
uses: actions/checkout@v2
- uses: mszostok/[email protected]
with:
checks: "files,syntax,owners,duppatterns"
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
# checks: "files,syntax,owners,duppatterns"
checks: "syntax,owners,duppatterns"
# GitHub access token is required only if the `owners` check is enabled
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"

0 comments on commit 167c78a

Please sign in to comment.