Skip to content

Commit

Permalink
add a document linter action (#23921)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuxu92 authored Nov 22, 2023
1 parent 7596b07 commit a65ac02
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/document-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Resource Document Linting

permissions:
contents: read
pull-requests: read

on:
pull_request:
types: ["opened", "synchronize"]
paths:
- ".github/workflows/document-lint.yaml"
- "internal/services/**"
- "website/**"
branches: ["main"]

jobs:
document-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
- run: make document-lint
continue-on-error: true
- name: check lint result
if: failure()
run: |
echo "::warning::Document linting failed. Please fix the issues."
3 changes: 3 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=azurerm

document-lint:
go run $(CURDIR)/internal/tools/document-lint/main.go check

scaffold-website:
./scripts/scaffold-website.sh

Expand Down

0 comments on commit a65ac02

Please sign in to comment.