mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
feat: Add GH checks and templates (#222)
This commit is contained in:
parent
c920368fb2
commit
53a866e775
8 changed files with 326 additions and 11 deletions
27
.github/workflows/pre-commit.yaml
vendored
Normal file
27
.github/workflows/pre-commit.yaml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: Common issues check
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
||||
- name: Get changed files
|
||||
id: file_changes
|
||||
run: |
|
||||
export DIFF=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }})
|
||||
echo "Diff between ${{ github.base_ref }} and ${{ github.sha }}"
|
||||
echo "::set-output name=files::$( echo "$DIFF" | xargs echo )"
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.9'
|
||||
- name: Execute pre-commit
|
||||
uses: pre-commit/action@v2.0.0
|
||||
env:
|
||||
SKIP: no-commit-to-branch
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
extra_args: --color=always --show-diff-on-failure --files ${{ steps.file_changes.outputs.files }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue