File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments