diff --git a/.github/workflows/assign-author.yml b/.github/workflows/assign-author.yml new file mode 100644 index 000000000..59c2e5d1c --- /dev/null +++ b/.github/workflows/assign-author.yml @@ -0,0 +1,18 @@ +name: 🤖 PR author as an assignee +on: + pull_request: + +jobs: + assign: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.0 + - uses: taiga-family/ci/actions/setup/variables@v1.87.0 + - uses: toshimaru/auto-author-assign@v2.1.1 + if: env.IS_OWNER_MODE == 'true' + with: + repo-token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 000000000..1bd5cf9b1 --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,53 @@ +name: 🤖 PR auto merge +on: + pull_request: + +env: + PR_JOBS_NAME: '[ "Packages", "Demo", "Firebase", "Lint result", "tests", "E2E result" ]' + +jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.value }} + steps: + - uses: actions/checkout@v4.2.0 + - uses: taiga-family/ci/actions/setup/variables@v1.87.0 + - id: matrix + run: | + if [[ "${{ env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR }}" == "true" ]]; then + echo "value=$PR_JOBS_NAME" >> $GITHUB_OUTPUT + else + echo "value=[]" >> $GITHUB_OUTPUT + fi + + wait: + needs: [setup] + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + value: ${{ fromJSON(needs.setup.outputs.matrix) }} + steps: + - uses: taiga-family/ci/actions/run/wait-job@v1.87.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + job: ${{ matrix.value }} + + approve: + needs: [wait] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.0 + - uses: taiga-family/ci/actions/setup/variables@v1.87.0 + - uses: taiga-family/ci/actions/auto/approve/double@v1.87.0 + with: + token1: ${{ secrets.GITHUB_TOKEN }} + token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }} + - uses: taiga-family/ci/actions/run/merge@v1.87.0 + with: + token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1cf3c0a5..aff4a9627 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,5 +24,5 @@ jobs: - run: npx nx build-gh-pages concurrency: - group: build-${{ github.head_ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 77fc4e0da..c20b84b1a 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -24,5 +24,5 @@ jobs: expires: 1d concurrency: - group: firebase-${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8fdbf2710..0dffd69cb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,5 +21,5 @@ jobs: clean: true concurrency: - group: deploy-${{ github.head_ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 190fb61b0..eeb7fa3aa 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,7 +2,7 @@ name: E2E on: [pull_request] env: - CACHE_DIST_KEY: dist-${{ github.head_ref }}-${{ github.ref }}-${{ github.sha }} + CACHE_DIST_KEY: dist-${{ github.ref }}-${{ github.sha }} CYPRESS_CACHE_FOLDER: ./node_modules/cache-cypress UNIVERSAL_SERVER: http://localhost:4000 STATIC_SERVER: http://localhost:8080 @@ -131,5 +131,5 @@ jobs: - run: echo "Success" concurrency: - group: e2e-${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 81677cd76..164c61b91 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -59,5 +59,5 @@ jobs: - run: echo "Success" concurrency: - group: lint-${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index f3a9a8483..000000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: 🤖 PR suites -on: - pull_request: - pull_request_review: - types: [submitted] - -env: - PR_JOBS_NAME: '[ "Packages", "Demo", "Firebase", "Lint result", "tests", "E2E result" ]' - -jobs: - setup: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.matrix.outputs.value }} - steps: - - uses: actions/checkout@v4.2.0 - - uses: taiga-family/ci/actions/setup/variables@v1.87.6 - - id: matrix - if: env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR == 'true' - run: echo "value=$PR_JOBS_NAME" >> $GITHUB_OUTPUT - - wait: - needs: [setup] - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - value: ${{ fromJSON(needs.setup.outputs.matrix) }} - steps: - - uses: taiga-family/ci/actions/run/wait-job@v1.87.6 - with: - token: ${{ secrets.GITHUB_TOKEN }} - job: ${{ matrix.value }} - - approve: - needs: [wait] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.2.0 - - uses: taiga-family/ci/actions/setup/variables@v1.87.6 - - uses: taiga-family/ci/actions/auto/approve/double@v1.87.6 - with: - token1: ${{ secrets.GITHUB_TOKEN }} - token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }} - - uses: taiga-family/ci/actions/run/merge@v1.87.6 - with: - token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} - - label-when-approved: - name: Label when approved - runs-on: ubuntu-latest - if: github.event.review.state == 'APPROVED' - steps: - - uses: actions/checkout@v4.2.0 - - uses: taiga-family/ci/actions/setup/variables@v1.87.6 - - uses: taiga-family/ci/actions/auto/label-when-approved@v1.87.6 - with: - approvals: 1 - token: ${{ secrets.GITHUB_TOKEN }} - - assign-author: - name: PR author as an assignee - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.2.0 - - uses: taiga-family/ci/actions/setup/variables@v1.87.6 - - uses: toshimaru/auto-author-assign@v2.1.1 - if: env.IS_OWNER_MODE == 'true' - with: - repo-token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} - -concurrency: - group: pr-suites-${{ github.head_ref }} - cancel-in-progress: true diff --git a/.github/workflows/ready-to-merge.yml b/.github/workflows/ready-to-merge.yml new file mode 100644 index 000000000..fe2421e35 --- /dev/null +++ b/.github/workflows/ready-to-merge.yml @@ -0,0 +1,21 @@ +name: 🤖 PR is ready to merge +on: + pull_request_review: + types: [submitted] + +jobs: + label-when-approved: + name: Label when approved + runs-on: ubuntu-latest + if: github.event.review.state == 'approved' + steps: + - uses: actions/checkout@v4.2.0 + - uses: taiga-family/ci/actions/setup/variables@v1.87.0 + - uses: taiga-family/ci/actions/auto/label-when-approved@v1.87.0 + with: + approvals: 1 + token: ${{ secrets.GITHUB_TOKEN }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4943b2073..d0dab6766 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,5 +40,5 @@ jobs: textLink: '@maskito/core' concurrency: - group: release-${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5effe5fb9..4f18e03a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,5 +69,5 @@ jobs: name: vue concurrency: - group: test-${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true