Skip to content

Update github actions #4

Update github actions

Update github actions #4

Workflow file for this run

name: Pull request
on:
- pull_request
jobs:
collectInputs:
name: Collect workflow inputs
runs-on: ubuntu-latest
outputs:
directories: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Get root directories
run: ls -d {modules,examples}/* | jq -R -s -c 'split("\n")[:-1]'
# run: echo "matrix=$(ls -d {modules,examples}/* | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
validatePullRequest:
name: Validate terraform pull PR
needs: collectInputs
runs-on: ubuntu-latest
strategy:
matrix:
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Validate configs
uses: dflook/terraform-validate@v1
with:
path: ${{ matrix.directory }}
- name: Render terraform docs inside the README.md and push changes back to PR branch
uses: terraform-docs/[email protected]
with:
args: --recursive-include-main=false --read-comments=false
working-dir: modules,examples
recursive: true
recursive-path: .
output-file: README.md
output-method: inject
git-push: "true"