Skip to content

Commit 7686338

Browse files
vjdhamaclaude
andcommitted
fix: make terraform-docs workflow Dependabot-safe
- Skip git push steps for dependabot[bot] actor - Use proper quoted string values for git-push parameter - Combine conditions for modules and examples steps - Prevents permission denied errors on Dependabot PRs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 55b3ee1 commit 7686338

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/terraform-docs.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ jobs:
2424
token: ${{ secrets.GITHUB_TOKEN }}
2525

2626
- name: Render and Push terraform docs for main module
27+
if: github.actor != 'dependabot[bot]'
2728
uses: terraform-docs/gh-actions@main
2829
with:
2930
working-dir: .
30-
git-push: true
31+
git-push: "true"
3132
output-file: README.md
3233
output-format: markdown table
3334
output-method: replace
@@ -44,11 +45,11 @@ jobs:
4445
run: echo "modules_exists=$(if [ -d modules ]; then echo true; else echo false; fi)" >> $GITHUB_ENV
4546

4647
- name: Render and Push terraform docs for sub modules
47-
if: env.modules_exists == 'true'
48+
if: env.modules_exists == 'true' && github.actor != 'dependabot[bot]'
4849
uses: terraform-docs/gh-actions@main
4950
with:
5051
working-dir: .
51-
git-push: true
52+
git-push: "true"
5253
output-file: README.md
5354
output-format: markdown table
5455
output-method: replace
@@ -67,11 +68,11 @@ jobs:
6768
run: echo "examples_exists=$(if [ -d examples ]; then echo true; else echo false; fi)" >> $GITHUB_ENV
6869

6970
- name: Render and Push terraform docs for examples
70-
if: env.examples_exists == 'true'
71+
if: env.examples_exists == 'true' && github.actor != 'dependabot[bot]'
7172
uses: terraform-docs/gh-actions@main
7273
with:
7374
working-dir: .
74-
git-push: true
75+
git-push: "true"
7576
output-file: README.md
7677
output-format: markdown table
7778
output-method: replace

0 commit comments

Comments
 (0)