Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
danhurwit committed Feb 12, 2024
1 parent 6acc4bf commit ca218c5
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: Run tfplugindocs
runs-on: ubuntu-latest
permissions:
contents: read
contents: write

steps:
- uses: actions/checkout@v2
Expand All @@ -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
Expand Down

0 comments on commit ca218c5

Please sign in to comment.