-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
3 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 |
---|---|---|
|
@@ -31,7 +31,7 @@ jobs: | |
name: Run tfplugindocs | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -43,18 +43,35 @@ jobs: | |
with: | ||
go-version: '1.20.5' # tfplugindocs requires go >= 1.18 | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Setup tfplugindocs | ||
run: | | ||
cd /tmp | ||
curl -L -o tfplugindocs.zip https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.15.0/tfplugindocs_0.15.0_linux_amd64.zip | ||
unzip tfplugindocs.zip | ||
chmod +x tfplugindocs | ||
- name: Compare generated files with checked in files | ||
- name: Checkout PR | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh pr checkout ${{ github.event.pull_request.number }} | ||
|
||
- name: Generate files with checked in files | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Dan Bot" | ||
rm -r docs | ||
/tmp/tfplugindocs | ||
git diff --stat --exit-code ./docs | ||
git add . | ||
git commit -m "added terraform docs" | ||
git push | ||
terraform_lint: | ||
|
||
name: Run terraform-lint | ||
|