Update angular monorepo #85
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
name: CI - Terraform | |
on: | |
push: | |
branches: main | |
pull_request: | |
env: | |
GITHUB_PR_BRANCH: "" | |
jobs: | |
terraform-validate: | |
name: Terraform Validate | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Get terraform version | |
id: get-terraform-version | |
run: | | |
DOTFILE_VERSION=$(cat .terraform-version) | |
echo "version=$DOTFILE_VERSION" >> $GITHUB_OUTPUT | |
- name: Setup Terraform | |
uses: hashicorp/[email protected] | |
with: | |
terraform_version: ${{ steps.get-terraform-version.outputs.version }} | |
- name: Run a Terraform init | |
run: | | |
terraform init | |
- name: Run a Terraform validate | |
run: | | |
terraform validate | |
- name: Run a Terraform format check | |
run: | | |
terraform fmt -check=true -diff=true | |
terraform-docs-validation: | |
name: Terraform Docs validation | |
needs: terraform-validate | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
token: ${{ secrets.TERRAFORM_DOCS_RENOVATE_WORKFLOW_GITHUB_TOKEN }} | |
- name: Get PR base branch | |
id: pr-base-branch-name | |
if: github.event_name == 'pull_request' | |
run: | | |
echo "GITHUB_PR_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV | |
- name: Get commit message | |
run: | | |
echo "GIT_COMMIT_MESSAGE=$(git show -s --format=%s)" >> $GITHUB_ENV | |
- name: Generate Terraform docs | |
uses: terraform-docs/[email protected] | |
if: "!startsWith(env.GITHUB_PR_BRANCH, 'renovate/')" | |
with: | |
working-dir: . | |
config-file: .terraform-docs.yml | |
output-file: README.md | |
output-method: inject | |
fail-on-diff: true | |
- name: Generate Terraform docs for Renovate | |
uses: terraform-docs/[email protected] | |
if: "startsWith(env.GITHUB_PR_BRANCH, 'renovate/')" | |
with: | |
working-dir: . | |
config-file: .terraform-docs.yml | |
output-file: README.md | |
output-method: inject | |
git-push: true | |
ref: ${{ github.event.pull_request.head.ref }} | |
git-commit-message: "${{ env.GIT_COMMIT_MESSAGE }} - Terraform Docs" |