Skip to content

Commit

Permalink
chore: add instructions to run tfdocs locally for forks in summary
Browse files Browse the repository at this point in the history
  • Loading branch information
d-costa committed Apr 19, 2024
1 parent e792768 commit 1660aca
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:

# Terraform-docs
- uses: terraform-docs/[email protected]
id: terraform-docs
with:
working-dir: .
output-file: README.md
Expand All @@ -53,3 +54,15 @@ jobs:
file_pattern: 'README.md'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Print instructions to run terraform-docs locally if changes are needed and workflow is running on fork
- if: ${{ !cancelled() && github.repository_owner != 'runatlantis' && steps.terraform-docs.outputs.num_changed > 0 }}
run: |
echo '### Please run terraform-docs locally and commit the changes:' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '```sh' >> $GITHUB_STEP_SUMMARY
echo 'docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.17.0 markdown --output-file README.md --output-mode inject /terraform-docs' >> $GITHUB_STEP_SUMMARY
echo 'git add README.md' >> $GITHUB_STEP_SUMMARY
echo 'git commit --amend --no-edit' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY

0 comments on commit 1660aca

Please sign in to comment.