-
Notifications
You must be signed in to change notification settings - Fork 63
55 lines (53 loc) · 2.14 KB
/
changesets_ci.yml
File metadata and controls
55 lines (53 loc) · 2.14 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
name: Changesets CI
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- "apps/**"
- "sdk/**"
- "dapps/**"
- "docs/site/**"
- ".changeset/**"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
jobs:
validate:
if: (github.event.pull_request.draft == false || contains(github.event.pull_request.body, '[run-ci]'))
runs-on: self-hosted-x64
steps:
- name: checkout code repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Install Nodejs
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- id: diff
name: Determine changed public packages from previous commit
run: echo "hasChanges=$(pnpm list --filter "...[$(git rev-parse HEAD^1)]" --depth -1 --json | jq "any(.[] | select(.private != true) ; length > 0)")" >> $GITHUB_OUTPUT
- name: Get changed files in the changesets folder
id: has-changesets
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45.0.3
with:
files: |
.changeset/**
- name: Create missing changeset note if there are missing changesets
if: steps.has-changesets.outputs.any_changed != 'true' && steps.diff.outputs.hasChanges == 'true'
run: |
echo "true" > missing-changeset.txt
- name: Upload missing changeset artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: steps.has-changesets.outputs.any_changed != 'true' && steps.diff.outputs.hasChanges == 'true'
with:
name: missing-changeset
path: missing-changeset.txt
if-no-files-found: error
retention-days: 1
- name: Attempt to create snapshots.
run: pnpm changeset version --snapshot test-do-not-publish