5
5
6
6
name : PR review companion
7
7
8
- on : workflow_call
8
+ on :
9
+ workflow_run :
10
+ workflows : ["PR Test"]
11
+ types :
12
+ - completed
9
13
10
14
jobs :
11
15
review :
12
16
runs-on : ubuntu-latest
17
+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
13
18
steps :
14
19
- name : " Download artifact"
15
20
uses : actions/download-artifact@v4
16
21
with :
17
- name : build
22
+ pattern : build
18
23
path : build
24
+ merge-multiple : true
25
+ github-token : ${{ secrets.GITHUB_TOKEN }}
26
+ run-id : ${{ github.event.workflow_run.id }}
27
+
28
+ - name : Check for artifacts
29
+ if : ${{ hashFiles('build/') != '' }}
30
+ run : |
31
+ echo "HAS_ARTIFACT=true" >> "$GITHUB_ENV"
19
32
20
33
- uses : actions/checkout@v4
34
+ if : ${{ env.HAS_ARTIFACT }}
21
35
with :
22
36
repository : mdn/yari
23
37
path : yari
24
38
25
39
- name : Install Python
40
+ if : ${{ env.HAS_ARTIFACT }}
26
41
id : setup-python
27
42
uses : actions/setup-python@v5
28
43
with :
29
44
python-version : " 3.10"
30
45
31
46
# See https://www.peterbe.com/plog/install-python-poetry-github-actions-faster
32
47
- name : Load cached ~/.local
48
+ if : ${{ env.HAS_ARTIFACT }}
33
49
uses : actions/cache@v4
34
50
with :
35
51
path : ~/.local
@@ -38,12 +54,14 @@ jobs:
38
54
key : dotlocal-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-0
39
55
40
56
- name : Install Python poetry
57
+ if : ${{ env.HAS_ARTIFACT }}
41
58
42
59
with :
43
60
virtualenvs-create : true
44
61
virtualenvs-in-project : true
45
62
46
63
- name : Load cached venv
64
+ if : ${{ env.HAS_ARTIFACT }}
47
65
id : cached-poetry-dependencies
48
66
uses : actions/cache@v4
49
67
with :
@@ -53,17 +71,19 @@ jobs:
53
71
key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ steps.setup-python.outputs.python-version }}-0
54
72
55
73
- name : Install poetry dependencies
56
- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
74
+ if : ${{ env.HAS_ARTIFACT && steps.cached-poetry-dependencies.outputs.cache-hit != 'true' }}
57
75
run : |
58
76
cd yari/deployer
59
77
poetry install --no-interaction --no-root
60
78
61
79
- name : Install Deployer
80
+ if : ${{ env.HAS_ARTIFACT }}
62
81
run : |
63
82
cd yari/deployer
64
83
poetry install --no-interaction
65
84
66
85
- name : Deploy and analyze built content
86
+ if : ${{ env.HAS_ARTIFACT }}
67
87
env :
68
88
BUILD_OUT_ROOT : ${{ github.workspace }}/build
69
89
0 commit comments