-
Notifications
You must be signed in to change notification settings - Fork 466
93 lines (85 loc) · 2.81 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: 🤖 PR suites
on:
pull_request:
pull_request_review:
types: [submitted]
env:
PR_JOBS_NAME: '[ "Build packages", "Firebase", "Lint", "Unit tests", "Component testing result", "E2E result" ]'
RELEASE_JOBS_NAME: '[ "Publish" ]'
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.value }}
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- id: matrix
if: env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR == 'true'
run: |
if [[ "${{ env.IS_RELEASE_BRANCH }}" == "false" ]]; then
echo "value=$PR_JOBS_NAME" >> $GITHUB_OUTPUT
else
echo "value=$RELEASE_JOBS_NAME" >> $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/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
job: ${{ matrix.value }}
approve:
needs: [wait]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/auto/approve/[email protected]
with:
token1: ${{ secrets.GITHUB_TOKEN }}
token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }}
- uses: taiga-family/ci/actions/run/[email protected]
if: env.IS_RELEASE_BRANCH == 'false'
with:
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}
label-when-approved:
name: Label when approved
if: github.event.review.state == 'APPROVED'
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/auto/[email protected]
with:
approvals: 2
token: ${{ secrets.GITHUB_TOKEN }}
assign-author:
name: PR author as an assignee
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: toshimaru/[email protected]
if: env.IS_OWNER_MODE == 'true'
with:
repo-token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}
label-version:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/run/[email protected]
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: pr-suites-${{ github.head_ref }}
cancel-in-progress: true