Skip to content

Commit d442609

Browse files
committed
chore: Ensure that action code is built
1 parent 09b88b1 commit d442609

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,36 @@ jobs:
8383
# workflow artifact.
8484
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
8585
name: Upload Artifact
86-
id: upload
86+
id: upload-dist
8787
uses: actions/upload-artifact@v4
8888
with:
8989
name: dist
9090
path: dist/
91+
92+
# This will fail the workflow if the `dist-action/` directory is different than
93+
# expected.
94+
- name: Compare Directories
95+
id: diff-action
96+
run: |
97+
if [ ! -d dist-action/ ]; then
98+
echo "Expected dist-action/ directory does not exist. See status below:"
99+
ls -la ./
100+
exit 1
101+
fi
102+
if [ "$(git diff --ignore-space-at-eol --text dist-action/ | wc -l)" -gt "0" ]; then
103+
echo "Detected uncommitted changes after build. See status below:"
104+
git diff --ignore-space-at-eol --text dist-action/
105+
exit 1
106+
fi
107+
108+
# If `dist-action/` was different than expected, upload the expected version as a
109+
# workflow artifact.
110+
- if: ${{ failure() && steps.diff-action.outcome == 'failure' }}
111+
name: Upload Artifact
112+
id: upload-dist-action
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: dist-action
116+
path: dist-action/
117+
118+

0 commit comments

Comments
 (0)