-
Notifications
You must be signed in to change notification settings - Fork 0
26 lines (26 loc) · 1.11 KB
/
yvm.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
name: yvm
on: pull_request
jobs:
yvm:
runs-on: ubuntu-latest
# When you set the yarn version via `policies set-version`, it will download
# that version of yarn into a `.yarn` folder at the root of your project. To
# save from downloading a specific version of yarn every time, we'll cache it
# and resue it instead. If it detects a new version of yarn, then it will
# download and save it for later.
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Cache yarn version
id: yarn-cache
uses: actions/cache@v2
with:
path: '**/.yarn'
key: yarn-cache-${{ hashFiles('**/.yvmrc') }}
- name: Read yarn version
id: yvm
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: echo "::set-output name=version::$(cat .yvmrc)"
- name: Set yarn version
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn policies set-version ${{ steps.yvm.outputs.version }}