generated from getsentry/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 57
45 lines (37 loc) · 968 Bytes
/
verify-dist.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
45
# Inspired by @action/checkout
#
# Compares the checked in `dist/index.js` with the PR's `dist/index.js`
# On mismatch this action fails
name: Verify dist
on:
push:
branches:
- master
- release/**
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
check-dist:
name: Verify dist/index.js file
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use volta
uses: volta-cli/action@v4
- name: Install dependencies
run: yarn install
- name: Rebuild dist
run: yarn build
- name: Compare expected and actual dist
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. Did you forget to commit `dist/index.js`?"
echo "Diff:"
git diff
exit 1
fi