From 2a2625b360128500ca92b175ecf23bc9ad798731 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Thu, 7 Nov 2024 14:13:10 -0800 Subject: [PATCH] chore: remove ci sdk validation check --- .github/workflows/validate_changed_files.sh | 31 ------------------- .github/workflows/validation.yml | 33 --------------------- 2 files changed, 64 deletions(-) delete mode 100755 .github/workflows/validate_changed_files.sh delete mode 100644 .github/workflows/validation.yml diff --git a/.github/workflows/validate_changed_files.sh b/.github/workflows/validate_changed_files.sh deleted file mode 100755 index d6edd6fa6..000000000 --- a/.github/workflows/validate_changed_files.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -o nounset -o pipefail - -INVALID_FILE_PATHS=('pkg/plugin/sdk') # Array of filepaths that are not allowed -VALID_FILE_PATHS=('pkg/plugin/sdk/v1alpha3') # Array of filepaths that are allowed - -# by default the only local branch will be pull/PR#/merge -# fetch only the latest commit from the 2 branches in question to avoid fetching the entire repo which could be costly - -git fetch --depth 1 origin "${GITHUB_BASE_REF}" -git fetch --depth 1 origin "${GITHUB_REF}" - -git diff --name-only "origin/${GITHUB_BASE_REF}..${GITHUB_SHA}" | while read -r file; do - - # check if filepath matches a valid path. If so move to the next change - for valid_path in "${VALID_FILE_PATHS[@]}"; do - if [[ "${file}" == "${valid_path}"* ]]; then - continue 2 - fi - done - - # check if filepath matches an invalid path - for invalid_path in "${INVALID_FILE_PATHS[@]}"; do - if [[ "${file}" == "${invalid_path}"* ]]; then - echo "Branch contains changes to versioned SDK files." - echo "Add the 'allow sdk change' tag to the PR and re-trigger CI to bypass this check." - exit 1 - fi - done -done diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml deleted file mode 100644 index 274c5522d..000000000 --- a/.github/workflows/validation.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Validation -on: - push: - branches: [main] - pull_request: - branches: [main] - # Allows you to run this workflow manually from the Actions tab. - workflow_dispatch: -concurrency: - # Cancel previous actions from the same PR or branch except 'main' branch. - # See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info. - group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}} - cancel-in-progress: ${{ github.ref_name != 'main' }} -jobs: - validation: - name: Validation - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Validate changed files - if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'allow sdk change') - run: ./.github/workflows/validate_changed_files.sh - - uses: bazelbuild/setup-bazelisk@v1 - - name: Go cache - uses: actions/cache@v2 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod', '**/go.sum') }} - restore-keys: ${{ runner.os }}-go- - - name: Tidy up repository - run: ./.github/workflows/tidy_up_repository.sh