-
Notifications
You must be signed in to change notification settings - Fork 50
41 lines (34 loc) · 1.18 KB
/
pre-submit.actions.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
name: Actions pre submits
on:
pull_request:
branches: [main]
workflow_dispatch:
permissions: read-all
jobs:
check-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set Node.js 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
- name: Rebuild the dist/ directory
working-directory: actions/installer
run: make package
- name: Compare the expected and actual dist/ directories
working-directory: actions/installer
id: diff
run: |
set -euo pipefail
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
# If index.js was different from expected, upload the expected version as an artifact
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/