Skip to content

Commit

Permalink
refactor(terraform-docs): Use tf-directory input throughout workflow (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chris3ware authored Feb 24, 2025
1 parent 0a8dc91 commit eba1297
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/terraform-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ jobs:
GITHUB_TOKEN: ${{ steps.decrypt-token.outputs.temp-token }}
uses: planetscale/ghcommit-action@c7915d6c18d5ce4eb42b0eff3f10a29fe0766e4c # v0.1.44
with:
commit_message: "docs(terraform): Update ${{ env.TF_DOCS_FILE }}"
commit_message: "docs(${{ inputs.tf-directory }}): Update ${{ env.TF_DOCS_FILE }}"
repo: ${{ github.repository }}
branch: ${{ env.BRANCH }}
file_pattern: "terraform/**/${{ env.TF_DOCS_FILE }}"
file_pattern: "${{ inputs.tf-directory }}/**/${{ env.TF_DOCS_FILE }}"

# This step produces a job summary if the commit fails or if the documents are not updated
- name: Summary with commit failure
if: ${{ failure() && steps.push-with-sig.outcome == 'failure' }}
if: ${{ (failure() && steps.push-with-sig.outcome == 'failure') || (success() && steps.push-with-sig.outputs.commit-hash == '') }}
run: |
echo "### :x: ${{ env.TF_DOCS_FILE }} not updated" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
Expand All @@ -75,7 +76,7 @@ jobs:
echo "Please review the logs" >> $GITHUB_STEP_SUMMARY
- name: Summary with document changes
if: ${{ steps.push-with-sig.conclusion == 'success' }}
if: ${{ steps.push-with-sig.conclusion == 'success' && steps.push-with-sig.outputs.commit-hash != ''}}
run: |
echo "### :white_check_mark: Terraform docs updated" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
Expand Down

0 comments on commit eba1297

Please sign in to comment.