From 60f42131d245e18db262a966d689ff39f3bb68c0 Mon Sep 17 00:00:00 2001 From: abalias Date: Thu, 8 Sep 2022 10:05:46 +0100 Subject: [PATCH] ci: disable linter autocommits, remove pr checker (#17) --- .github/workflows/lint.yml | 29 --------------- .github/workflows/pr-check.yml | 64 ---------------------------------- 2 files changed, 93 deletions(-) delete mode 100644 .github/workflows/pr-check.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ae4e15a009..2b0a31ab14 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,35 +32,6 @@ jobs: - name: Mega-Linter id: ml uses: megalinter/megalinter@v6 - - name: Prepare commit - if: | - (success() || failure()) && - steps.ml.outputs.has_updated_sources == 1 && - github.event_name == 'pull_request' - run: sudo chown -Rc ${UID} .git/ - - name: Import GPG key - id: import_gpg - if: | - (success() || failure()) && - steps.ml.outputs.has_updated_sources == 1 && - github.event_name == 'pull_request' - uses: crazy-max/ghaction-import-gpg@v3 - with: - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - git-user-signingkey: true - git-commit-gpgsign: true - - name: Commit and push applied linter fixes - if: | - (success() || failure()) && - steps.ml.outputs.has_updated_sources == 1 && - github.event_name == 'pull_request' - uses: stefanzweifel/git-auto-commit-action@v4 - with: - branch: ${{ github.event.pull_request.head.ref }} - commit_message: "[Mega-Linter] Apply linters fixes" - commit_options: "--gpg-sign" - commit_user_name: ${{ steps.import_gpg.outputs.name }} - commit_user_email: ${{ steps.import_gpg.outputs.email }} - name: Archive production artifacts if: success() || failure() uses: actions/upload-artifact@v2 diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml deleted file mode 100644 index 30ff24aa4e..0000000000 --- a/.github/workflows/pr-check.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Check PR - -env: - # Maximum number of lines allowed to be changed in one PR - MAX_CHANGED_LINES: 1000 - PR_TITLE_MAX_LENGTH: 70 - # Title must be `[ATL-1234] ...` - PR_TITLE_REGEXP: '\[\w+-\d+\] .+' - -defaults: - run: - shell: bash - -on: - pull_request: - types: [opened, edited, synchronize, reopened] - -jobs: - check-pr-title: - name: "Check PR title" - runs-on: ubuntu-latest - steps: - - uses: deepakputhraya/action-pr-title@master - name: Validate PR Title - with: - regex: ${{ env.PR_TITLE_REGEXP }} - max_length: ${{ env.PR_TITLE_MAX_LENGTH }} - github_token: ${{ secrets.ATALA_GITHUB_TOKEN }} - - uses: mshick/add-pr-comment@v1 - name: Comment on PR - if: failure() - env: - GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} - with: - message: | - Please fix the title of this PR.
- If you don't have ATL number, you must create it.
- Examples: - * `[ATL-1234] New feature description` - * `[ATL-1234] [HUGE] Huge new feature description (mind the space between ] and [)` - check-pr-size: - name: "Check PR size" - runs-on: ubuntu-latest - env: - TITLE: ${{ github.event.pull_request.title }} - steps: - - name: Checkout the repo - uses: actions/checkout@v2 - - name: Get diff - uses: technote-space/get-diff-action@v5 - with: - SET_ENV_NAME_LINES: LINES_CHANGED - - name: Check diff size - run: | - echo "This PR changes: ${LINES_CHANGED} lines" - if [[ ${TITLE} =~ [HUGE] ]]; then - echo "PR marked as [HUGE], skipping size check." - exit 0 - fi - if (( LINES_CHANGED > MAX_CHANGED_LINES )); then - echo "ERROR: This PR changes more than ${MAX_CHANGED_LINES} lines." - echo "Please, separate this PR to small parts. Thanks!" - exit 1 - fi