diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml index cd407bef432..4ad434cd03b 100644 --- a/.github/workflows/opentelemetry.yml +++ b/.github/workflows/opentelemetry.yml @@ -27,7 +27,6 @@ on: - x-pack-metricbeat - x-pack-osquerybeat - x-pack-packetbeat - - pre-commit - check-default - check-docs types: [completed] diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index a54c1447145..00000000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: pre-commit - -on: - pull_request: - -permissions: - contents: read - pull-requests: read - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 - with: ## let's skip to run for all the files - extra_args: --help - - id: files - uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42 - - name: Configure PATH - run: echo "${GITHUB_WORKSPACE}/.ci/scripts" >> $GITHUB_PATH - - name: Precommit changes - run: | - for changed_file in ${{ steps.files.outputs.all }}; do - pre-commit run --files "${changed_file}" - done diff --git a/Jenkinsfile b/Jenkinsfile index 7c60957f75a..1bca8803290 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -221,9 +221,21 @@ def runChecks() { mapParallelTasks["${k}"] = v } } + // Run pre-commit within the current node and in Jenkins + // hence there is no need to use docker login in the GitHub actions + // some docker images are hosted in an internal docker registry. + mapParallelTasks['pre-commit'] = runPreCommit() parallel(mapParallelTasks) } +def runPreCommit() { + return { + withGithubNotify(context: 'Check pre-commit', tab: 'tests') { + preCommit(commit: "${GIT_BASE_COMMIT}", junit: true) + } + } +} + def runBuildAndTest(Map args = [:]) { def filterStage = args.get('filterStage', 'mandatory') deleteDir()