From 7bf5a7670a803b3f39140a55da6d71d8e389c6d0 Mon Sep 17 00:00:00 2001 From: Tore Martin Hagen Date: Mon, 23 Sep 2024 13:00:15 +0200 Subject: [PATCH] Remove auto-approve job --- .github/workflows/auto-approve.yml | 70 ------------------------------ 1 file changed, 70 deletions(-) delete mode 100644 .github/workflows/auto-approve.yml diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml deleted file mode 100644 index 1d259703..00000000 --- a/.github/workflows/auto-approve.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Auto approve -on: - pull_request_target: - types: - - opened - branches: - - main - -jobs: - auto-approve: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - permissions: - pull-requests: write - contents: write - - steps: - - name: check requester - run: | - # fail job if the requester is not a member of the organization - - curl --fail --header "Authorization: token ${{ secrets.READ_KOSLI_GH_ORG_MEMBERS }}" \ - https://api.github.com/orgs/kosli-dev/members \ - | jq -r ".[].login" \ - | grep -w "${{ github.event.pull_request.user.login }}" - result=$? - - if [[ $result -eq 0 ]]; then - echo "User ${{ github.event.pull_request.user.login }} is a member of kosli-dev" - else - echo "User ${{ github.event.pull_request.user.login }} is not a member of kosli-dev" - exit 1 - fi - - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v41 - - - name: Check non critical - id: non-critical - run: | - ACCEPTED_PATHS="^bin/|^design-docs/|^charts/k8s-reporter/README.md|^docs.kosli.com/content/helm/_index.md" - CRITICAL=false - if [ -z "${{ steps.changed-files.outputs.all_changed_files }}" ]; then - echo "empty file list" - # we get this if we use never_alone_create_pull_request_for_old_commit.sh - CRITICAL=true - fi - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - echo "$file" - # set CRITICAL as true when a file does not match the ACCEPTED_PATHS - [[ "$file" =~ ${ACCEPTED_PATHS} ]] || CRITICAL=true - done - echo "critical=${CRITICAL}" >> "$GITHUB_OUTPUT" - - - name: Approve pull request - if: ${{ steps.non-critical.outputs.critical == 'false' }} - uses: hmarr/auto-approve-action@v3 - with: - review-message: "Auto approved since only non critical files were changed" - - - - name: Merge to master - if: ${{ steps.non-critical.outputs.critical == 'false' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MERGE_LABELS: "" - MERGE_METHOD: squash - MERGE_ERROR_FAIL: true - uses: pascalgn/automerge-action@v0.15.6