From c624c03fc86d851f6c7a9754003539ddc3cb8144 Mon Sep 17 00:00:00 2001 From: splincode Date: Fri, 20 Sep 2024 19:15:07 +0300 Subject: [PATCH] ci: combine workflows --- .github/workflows/auto-add-version-label.yml | 17 ---------- .github/workflows/auto-author-assign.yml | 16 --------- .github/workflows/auto-dependency-review.yml | 12 ------- .github/workflows/auto-label.yml | 16 --------- .github/workflows/auto-remove-label.yml | 11 ------ .github/workflows/codeql-analysis.yml | 25 -------------- .github/workflows/delete-preview.yml | 1 + .../workflows/{auto-approve.yml => pr.yml} | 34 +++++++++++++++++++ 8 files changed, 35 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/auto-add-version-label.yml delete mode 100644 .github/workflows/auto-author-assign.yml delete mode 100644 .github/workflows/auto-dependency-review.yml delete mode 100644 .github/workflows/auto-label.yml delete mode 100644 .github/workflows/auto-remove-label.yml delete mode 100644 .github/workflows/codeql-analysis.yml rename .github/workflows/{auto-approve.yml => pr.yml} (59%) diff --git a/.github/workflows/auto-add-version-label.yml b/.github/workflows/auto-add-version-label.yml deleted file mode 100644 index 2b170223084d..000000000000 --- a/.github/workflows/auto-add-version-label.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 🤖 Auto add label version -on: - pull_request: - types: [opened] - -jobs: - label-version: - runs-on: ubuntu-latest - steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.76.0 - - uses: taiga-family/ci/actions/setup/variables@v1.76.0 - - uses: taiga-family/ci/actions/run/node-info@v1.76.0 - id: nodejs-workspace - - uses: actions-ecosystem/action-add-labels@v1 - continue-on-error: true - with: - labels: v${{ steps.nodejs-workspace.outputs.root-package-major-version }} diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml deleted file mode 100644 index dab004bbfd58..000000000000 --- a/.github/workflows/auto-author-assign.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 🤖 Auto assign -on: - pull_request: - types: [opened, reopened] - -jobs: - assign-author: - name: PR author as an assignee - runs-on: ubuntu-latest - steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.76.0 - - uses: taiga-family/ci/actions/setup/variables@v1.76.0 - - uses: toshimaru/auto-author-assign@v2.1.1 - if: env.IS_OWNER_MODE == 'true' - with: - repo-token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} diff --git a/.github/workflows/auto-dependency-review.yml b/.github/workflows/auto-dependency-review.yml deleted file mode 100644 index 57ce1aba4f3f..000000000000 --- a/.github/workflows/auto-dependency-review.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: 🤖 Auto dependency review -on: - pull_request: -permissions: - contents: read - -jobs: - dependency-review: - runs-on: ubuntu-latest - steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.76.0 - - uses: taiga-family/ci/actions/security/dependency-review@v1.76.0 diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml deleted file mode 100644 index a0ed370fe9c9..000000000000 --- a/.github/workflows/auto-label.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 🤖 Auto label -on: - pull_request_review: - types: [submitted] - -jobs: - label-when-approved: - if: github.event.review.state == 'APPROVED' - name: Label when approved - runs-on: ubuntu-latest - steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.76.0 - - uses: taiga-family/ci/actions/setup/variables@v1.76.0 - - uses: taiga-family/ci/actions/auto/label-when-approved@v1.76.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/auto-remove-label.yml b/.github/workflows/auto-remove-label.yml deleted file mode 100644 index 41a19af9e92b..000000000000 --- a/.github/workflows/auto-remove-label.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 🤖 Auto remove label on closed issue -on: - issues: - types: [closed] - -jobs: - remove_label: - runs-on: ubuntu-latest - steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.76.0 - - uses: taiga-family/ci/actions/auto/remove-label@v1.76.0 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 1ac8c01fd3a6..000000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: ⚙️ CodeQL -on: - push: - branches: [main] - pull_request: - branches: [main] - schedule: - - cron: '40 7 * * 6' - -jobs: - analyze: - if: ${{ !contains(github.head_ref, 'release/') }} - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - steps: - - uses: taiga-family/ci/actions/setup/checkout@v1.76.0 - - uses: taiga-family/ci/actions/security/codeql@v1.76.0 - -concurrency: - group: codeql-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true diff --git a/.github/workflows/delete-preview.yml b/.github/workflows/delete-preview.yml index a35c815c0e46..4a4af2fdc530 100644 --- a/.github/workflows/delete-preview.yml +++ b/.github/workflows/delete-preview.yml @@ -2,6 +2,7 @@ name: Close PR delete firebase channel on: pull_request: types: [closed] + jobs: delete_firebase_channel: runs-on: ubuntu-latest diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/pr.yml similarity index 59% rename from .github/workflows/auto-approve.yml rename to .github/workflows/pr.yml index 9478890d8744..70d343628f8c 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/pr.yml @@ -50,6 +50,40 @@ jobs: with: token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} + label-when-approved: + name: Label when approved + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.7 + - uses: taiga-family/ci/actions/setup/variables@v1.80.0 + - uses: taiga-family/ci/actions/auto/label-when-approved@v1.80.0 + with: + approvals: 2 + token: ${{ secrets.GITHUB_TOKEN }} + + assign-author: + name: PR author as an assignee + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.7 + - uses: taiga-family/ci/actions/setup/variables@v1.80.0 + - uses: toshimaru/auto-author-assign@v2.1.1 + if: env.IS_OWNER_MODE == 'true' + with: + repo-token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} + + label-version: + runs-on: ubuntu-latest + steps: + - uses: taiga-family/ci/actions/setup/checkout@v1.76.0 + - uses: taiga-family/ci/actions/setup/variables@v1.76.0 + - uses: taiga-family/ci/actions/run/node-info@v1.76.0 + id: nodejs-workspace + - uses: actions-ecosystem/action-add-labels@v1 + continue-on-error: true + with: + labels: v${{ steps.nodejs-workspace.outputs.root-package-major-version }} + concurrency: group: auto-approve-${{ github.head_ref }} cancel-in-progress: true