7
7
name : PR Test
8
8
9
9
on :
10
- # The `GITHUB_TOKEN` in workflows triggered by the `pull_request_target` event
11
- # is granted read/write repository access.
12
- # Please pay attention to limit the permissions of each job!
13
- # https://docs.github.com/actions/using-jobs/assigning-permissions-to-jobs
14
- pull_request_target :
10
+ pull_request :
15
11
branches :
16
12
- main
17
13
18
14
jobs :
19
15
tests :
20
- # do not run on PRs in forks
21
16
if : github.repository == 'mdn/translated-content'
22
17
runs-on : ubuntu-latest
23
18
# Set the permissions to `read-all`, preventing the workflow from
@@ -112,14 +107,14 @@ jobs:
112
107
113
108
working-directory : ${{ github.workspace }}/mdn/content
114
109
run : |
115
- mkdir -p ${ BUILD_OUT_ROOT}
110
+ mkdir -p $BUILD_OUT_ROOT
116
111
117
112
# Don't use `yarn build` (from mdn/content) because that one hardcodes
118
113
# the BUILD_OUT_ROOT and CONTENT_ROOT env vars.
119
114
node node_modules/@mdn/yari/build/cli.js ${GIT_DIFF_CONTENT}
120
115
121
116
echo "Disk usage size of build"
122
- du -sh ${ BUILD_OUT_ROOT}
117
+ du -sh $BUILD_OUT_ROOT
123
118
124
119
# Save the PR number into the build
125
120
echo ${{ github.event.number }} > ${BUILD_OUT_ROOT}/NR
@@ -130,16 +125,13 @@ jobs:
130
125
# be able to use this raw diff file for the benefit of analyzing.
131
126
wget https://github.com/${{ github.repository }}/compare/${BASE_SHA}...${HEAD_SHA}.diff -O ${BUILD_OUT_ROOT}/DIFF
132
127
133
- # Set the output variable so the next job could skip if there are no assets
134
- echo "has_assets=true" >> "$GITHUB_OUTPUT"
135
-
136
128
- name : Merge static assets with built documents
137
129
if : env.GIT_DIFF_CONTENT
138
130
run : |
139
131
# Exclude the .map files, as they're used for debugging JS and CSS.
140
132
rsync -a --exclude "*.map" ${{ github.workspace }}/mdn/content/node_modules/@mdn/yari/client/build/ ${BUILD_OUT_ROOT}
141
133
# Show the final disk usage size of the build.
142
- du -sh ${ BUILD_OUT_ROOT}
134
+ du -sh $BUILD_OUT_ROOT
143
135
144
136
- uses : actions/upload-artifact@v4
145
137
if : env.GIT_DIFF_CONTENT
@@ -154,16 +146,6 @@ jobs:
154
146
CONTENT_TRANSLATED_ROOT : ${{ github.workspace }}/files
155
147
working-directory : ${{ github.workspace }}/mdn/content
156
148
run : |
157
- echo ${GIT_DIFF_FILES}
158
-
159
- yarn filecheck ${GIT_DIFF_FILES}
160
-
161
- review :
162
- needs : tests
163
- if : needs.tests.outputs.has_assets
164
- # write permissions are required to create a comment in the corresponding PR
165
- permissions : write-all
166
- uses : ./.github/workflows/pr-review-companion.yml
167
- # inherit the secrets from the parent workflow
168
- # https://docs.github.com/actions/using-workflows/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow
169
- secrets : inherit
149
+ echo $GIT_DIFF_FILES
150
+
151
+ yarn filecheck $GIT_DIFF_FILES
0 commit comments