-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tfplugindocs github workflow to lint pull requests
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
name: 'tfplugindocs' | ||
on: | ||
pull_request: | ||
permissions: | ||
contents: read | ||
jobs: | ||
tfplugindocs: | ||
permissions: | ||
contents: read | ||
pull-requests: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18 | ||
- name: Get dependencies | ||
run: go mod download | ||
- name: Run tfplugindocs | ||
run: go generate ./... | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
- name: Fail if any files changed | ||
shell: bash | ||
run: | | ||
if [[ $(git status --porcelain=v1 | wc -l) -ne 0 ]]; then | ||
echo "Please ensure tfplugindocs changes are committed" | ||
echo "Changed files:" | ||
git diff --name-only | ||
exit 1 | ||
fi |