Skip to content

Commit

Permalink
Merge pull request #25 from sourcefuse/add-pre-commit-workflow
Browse files Browse the repository at this point in the history
Add pre commit workflow
  • Loading branch information
mayank0202 authored May 30, 2024
2 parents d5f1c4a + 7ba3188 commit e62c305
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ indent_size = 2
indent_style = space

[*.md]
max_line_length = 0
max_line_length = 200
trim_trailing_whitespace = false

[Makefile]
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: "Run Pre Commit Checks"

on: # yamllint disable-line rule:truthy
push:
branches:
- '**'
- '!main'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
## run pre-commit
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: write
pages: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.ARC_JOB_TOKEN }}

- uses: actions/setup-python@v3

- name: Install terraform-docs
run: |
cd /tmp
curl -sSLo ./terraform-docs.tar.gz \
https://terraform-docs.io/dl/v0.16.0/terraform-docs-v0.16.0-$(uname)-amd64.tar.gz
tar -xzf terraform-docs.tar.gz
rm terraform-docs.tar.gz
chmod +x terraform-docs
mv terraform-docs /usr/local/bin/terraform-docs
- name: Install tflint
run: |
cd /tmp
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
- name: Run pre-commit
uses: pre-commit/[email protected]
continue-on-error: true # we want to push the changes pre-commit makes

- name: Push pre-commit changes to branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Push pre-commit changes
2 changes: 2 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/AD-Connector/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/Microsoft-AD/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e62c305

Please sign in to comment.