Skip to content

Commit

Permalink
updating workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Aug 15, 2024
2 parents 11804f0 + bef86d9 commit c802841
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/terraform_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: CSVD/gh-actions-checkout@v3
with:
github-server-url: https://github.e.it.census.gov
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_TOKEN }}


- uses: CSVD/gh-actions-setup-node@v3
Expand All @@ -36,15 +38,26 @@ jobs:
with:
terraform_version: ${{ vars.terraform_version }}

- name: Set output
id: vars
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}

- name: Terraform Format
id: fmt
run: |
terraform fmt -check
terraform fmt
if ! git diff-index --quiet HEAD; then
git config --global user.name '${{ vars.REPO_OWNER }}'
git config --global user.email '${{ vars.REPO_OWNER_EMAIL }}'
git commit -am "Autoformatting TF Code"
git push
echo "auto_format=true" >> $GITHUB_ENV
fi
- name: Autoformat Halt
if: env.auto_format == 'true'
run: exit 1

run: exit 0
- name: Terraform Init
id: init
run: terraform init -upgrade
Expand Down

0 comments on commit c802841

Please sign in to comment.