-
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
5 changed files
with
164 additions
and
77 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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
name: Generate terraform docs | ||
on: | ||
- pull_request | ||
- push | ||
|
||
jobs: | ||
docs: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Graphviz | ||
uses: ts-graphviz/setup-graphviz@v2 | ||
|
@@ -21,21 +20,25 @@ jobs: | |
shell: bash | ||
working-directory: terraform/azure-devops/create-service-connection | ||
|
||
- name: Render terraform docs and push changes back to PR | ||
- name: Render terraform docs | ||
uses: terraform-docs/gh-actions@main | ||
with: | ||
config-file: doc-gen/.terraform-docs.yml | ||
working-dir: terraform/azure-devops/create-service-connection | ||
output-format: markdown table | ||
git-push: false | ||
|
||
- name: Fix .git permissions | ||
run: sudo chmod -R ugo+rwX .git | ||
|
||
- name: Commit changes | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add graph.png | ||
git add README.md | ||
git config --local user.email "" | ||
git config --local user.name "GitHub Actions" | ||
git diff-index --quiet HEAD || git commit -m "Update docs" | ||
git push | ||
# git diff-index --quiet HEAD || (git add -A && git commit -m'[bot] update files' --allow-empty && git push -f) | ||
shell: bash | ||
working-directory: terraform/azure-devops/create-service-connection |
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
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
Oops, something went wrong.