Skip to content

Commit 623184c

Browse files
authored
Validate library is up to date in workflow (#121)
1 parent 91c8f42 commit 623184c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/pr-validation.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,25 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v3
2020

21-
# Runs a single command using the runners shell
21+
# Set up NPM and deps
2222
- name: Set up NPM
2323
run: npm ci
2424

25-
# Runs a set of commands using the runners shell
25+
# Do a build
2626
- name: Run Build
2727
run: npm run build
2828

29+
# Check whether the compiled library changed
30+
- name: Check Build Updated
31+
uses: tj-actions/verify-changed-files@v9.2
32+
id: verify-built-lib
33+
with:
34+
files: lib/index.js
35+
36+
# If it did change, the authro forgot to build. Fail the action
37+
- name: Verify Build Updated
38+
if: steps.verify-changed-files.outputs.files_changed == 'true'
39+
run: exit 1
40+
2941
- name: Run Tests
3042
run: npm test

0 commit comments

Comments
 (0)