File tree 1 file changed +12
-2
lines changed 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
# ###############################################################################
2
2
# File: .github/workflows/unicode_warn.yml
3
- # Version: 0.3
3
+ # Version: 0.4
4
4
# Purpose: Detects Unicode in PRs and comments the results of findings in PR
5
5
# Authors: Michael Altfield <michael@michaelaltfield.net>
6
6
# Created: 2021-11-20
26
26
pull-requests : write
27
27
28
28
steps :
29
+
30
+ - name : Dump GitHub context
31
+ env :
32
+ GITHUB_CONTEXT : ${{ toJSON(github) }}
33
+ run : echo "$GITHUB_CONTEXT"
29
34
30
35
- name : Prereqs
31
36
env :
@@ -45,11 +50,15 @@ jobs:
45
50
git config --global --add safe.directory "$(pwd)"
46
51
git branch -a
47
52
git log
53
+ git checkout ${{ github.event.pull_request.head.ref }}
54
+ git branch -a
55
+ git log
48
56
49
57
diff=`git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)'`
50
58
if [ $? -ne 0 ]; then
51
59
# there was an error in the diff
52
60
human_result="WARNING: git diff failed!"
61
+ echo "UNICODE_HUMAN_RESULT=${human_result}" >> $GITHUB_ENV
53
62
echo "${human_result}"
54
63
exit 1
55
64
fi
62
71
if [ $? -ne 0 ]; then
63
72
# there was an error in the hexdump
64
73
human_result="WARNING : hexdump failed!"
74
+ echo "UNICODE_HUMAN_RESULT=${human_result}" >> $GITHUB_ENV
65
75
echo "${human_result}"
66
76
exit 1
67
77
fi
@@ -106,7 +116,7 @@ jobs:
106
116
- name : Exit with or without error
107
117
run : |
108
118
109
- if [[ "${{ env.UNICODE_HUMAN_RESULT }}" | grep -i " WARNING" ]]; then
119
+ if [[ "${{ env.UNICODE_HUMAN_RESULT }}" | grep -Ei "ERROR| WARNING" ]]; then
110
120
exit 1
111
121
else
112
122
exit 0
You can’t perform that action at this time.
0 commit comments