-
Notifications
You must be signed in to change notification settings - Fork 16
42 lines (34 loc) · 1.21 KB
/
versioning.yaml
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
name: Messari Substreams Versioning
on:
pull_request:
jobs:
validate-versions:
name: ValidateSubstreamVersioning
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.base_ref }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('./scripts/package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: cd scripts && npm ci --ignore-scripts
- name: Validate versions
run: |
cd scripts
CURRENT_VERSIONS=$(npm run versions:list -s)
git checkout ${{ github.head_ref }}
PR_VERSIONS=$(npm run versions:list -s)
URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}/files"
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename')
SHOULD_UPDATE=$(npm run versions:update:list $(echo $PR_FILES) -s)
npm run versions:validate $CURRENT_VERSIONS $PR_VERSIONS $SHOULD_UPDATE -s