From efee9936a713764081489af3262b74aaff17f844 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 22 Jan 2025 11:39:17 +0100 Subject: [PATCH] github-actions(pre-commit): detect merge conflicts and shebangs (#4344) --- .buildkite/hooks/post-checkout | 0 .buildkite/scripts/local_build.sh | 0 .github/workflows/pre-commit.yml | 18 ++++++++++++++++++ .pre-commit-config.yaml | 8 ++++++++ gobenchdata-checks.yml | 0 5 files changed, 26 insertions(+) mode change 100644 => 100755 .buildkite/hooks/post-checkout mode change 100644 => 100755 .buildkite/scripts/local_build.sh create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml mode change 100755 => 100644 gobenchdata-checks.yml diff --git a/.buildkite/hooks/post-checkout b/.buildkite/hooks/post-checkout old mode 100644 new mode 100755 diff --git a/.buildkite/scripts/local_build.sh b/.buildkite/scripts/local_build.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..23545b29c --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,18 @@ +name: pre-commit + +on: + pull_request: + push: + branches: + - main + - 8.* + - 9.* + +permissions: + contents: read + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: elastic/oblt-actions/pre-commit@v1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..44c4915bf --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + args: ['--assume-in-merge'] diff --git a/gobenchdata-checks.yml b/gobenchdata-checks.yml old mode 100755 new mode 100644