-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (61 loc) · 2.61 KB
/
code-review.yml
File metadata and controls
66 lines (61 loc) · 2.61 KB
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
name: Code Review
on:
workflow_dispatch:
inputs:
pullNumber:
description: 'Number of the pull request to review'
required: true
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.inputs.pullNumber || github.event.number }}
cancel-in-progress: true
jobs:
code_review:
# Auto-run only on same-repo PRs to expo/expo. Fork PRs don't get
# EXPO_BOT_GITHUB_TOKEN under `pull_request`, so the review would fail
# anyway — skip cleanly instead of leaving a red check. Forks dispatching
# this workflow manually would also fail for the same reason; gate on
# `github.repository` to short-circuit.
if: >-
github.repository == 'expo/expo' &&
(github.event_name == 'workflow_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: 👀 Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: 🔨 Install pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 10
- name: ⬢ Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: 'pnpm'
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(pwd)/bin" >> $GITHUB_PATH
- name: 📦 Install dependencies
run: pnpm install --ignore-scripts --frozen-lockfile
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
### This job is run on Ubuntu which doesn't have SwiftLint installed, so we need to build it from sources.
### Building it on each run may take too much time, so we bundle the binary in `@expo/swiftlint` package.
### To update SwiftLint, uncomment steps below, download the artifact and update that package.
# - name: 👷 Build and install SwiftLint
# run: |
# git clone https://github.com/realm/SwiftLint.git --branch 0.57.0 --depth 1
# cd SwiftLint
# swift build -c release
# cp .build/release/swiftlint /usr/local/bin/
# - name: 📦 Make an artifact
# uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
# with:
# name: swiftlint
# path: SwiftLint/.build
# include-hidden-files: true
- name: 🔬 Reviewing a pull request
run: pnpm expotools code-review --pr ${{ github.event.inputs.pullNumber || github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}