[feature] add blockchain module #43
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: Terraform CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.tf' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**.tf' | |
jobs: | |
Timestamp: | |
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main | |
terraform: | |
needs: [ Timestamp ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: "1.8.2" | |
- name: Terraform Format Check | |
run: terraform fmt -check | |
continue-on-error: true # This will mark the step as completed even if formatting errors are found | |
- name: Terraform Format | |
id: format | |
run: | | |
terraform fmt -recursive | |
echo "updated=$(git status --porcelain | grep '\.tf' | wc -l)" >> $GITHUB_ENV | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Automated Terraform format corrections | |
branch: ${{ github.head_ref }} | |
file_pattern: '*.tf' | |
if: env.updated == '1' |