generated from finos/software-project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 114
44 lines (41 loc) · 1.62 KB
/
check-changeset.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Check Changeset
# NOTE: changeset validation only makes sense in PR pipeline
on:
pull_request:
branches:
- '**'
# Cancel running jobs from previous pipelines of the same workflow on PR to save resource when commits are pushed quickly
concurrency:
group: ci-pr-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
check-changeset:
name: Validate Changesets
# When cherry-picking changes in recovery releases, since the changesets should already been consumed
# as part of the release, we will skip this checks.
# See https://github.com/finos/legend-studio/blob/master/docs/workflow/release-process.md#recovery-releases
if: "github.event.pull_request.base.ref != 'master' || !startsWith(github.event.pull_request.title, 'Cherry-picking changes in version ')"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0 # needed to validate changeset
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Setup Yarn cache
uses: actions/cache@v4.1.2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Setup Node
uses: actions/setup-node@v4.1.0
with:
node-version: 21
- name: Install dependencies
run: yarn
- name: Validate changesets
run: yarn check:changeset