24
24
run : |
25
25
sudo apt-get update || exit 1
26
26
sudo apt-get install -y yamllint golang-go pandoc || exit 1
27
- go version || { printf "::error file=.github/workflow/makefile-lint.yml,line=25,endLine=27,title=FAILURE::ERROR %s\n" "Go installation failed."; exit 1; }
27
+ ERR_MSG_STUB="Go installation failed."
28
+ ERR_DETAILS="file=.github/workflow/makefile-lint.yml,line=25,endLine=30,title=FAILURE"
29
+ ERR_MSG_LINE="::error ${ERR_DETAILS}::ERROR ${ERR_MSG_STUB}"
30
+ go version || { printf "%s\n" "${ERR_MSG_LINE}"; exit 1; }
28
31
- name : Lint Workflow YAML
29
32
if : ${{ success() }}
30
33
run : |
41
44
EXPECTED_SHA="48ab7819837d1bdfcbac58e301478a06efebf4a8" # v0.2.2
42
45
ACTUAL_SHA=$(git rev-parse HEAD)
43
46
if [ "$EXPECTED_SHA" != "$ACTUAL_SHA" ]; then
44
- { printf "::error file=.github/workflow/makefile-lint.yml,line=39,endLine=44,title=FAILURE::ERROR %s\n" "Checkmake repository hash verification failed." ; exit 1; }
47
+ ERR_MSG_STUB="Checkmake repository hash verification failed."
48
+ ERR_DETAILS="file=.github/workflow/makefile-lint.yml,line=42,endLine=51,title=FAILURE"
49
+ ERR_MSG_LINE="::error ${ERR_DETAILS}::ERROR ${ERR_MSG_STUB}"
50
+ printf "%s\n" "${ERR_MSG_LINE}"
51
+ exit 1;
45
52
fi
46
- make || { printf "::error file=.github/workflow/makefile-lint.yml,line=46,endLine=46,title=FAILURE::ERROR %s\n" "Checkmake build failed."; exit 1; }
53
+ make || { \
54
+ ERR_MSG_STUB="Checkmake build failed." \
55
+ ERR_DETS="file=.github/workflow/makefile-lint.yml,line=52,endLine=57,title=FAILURE" \
56
+ ERR_MSG_LINE="::error ${ERR_DETS}::ERROR ${ERR_MSG_STUB}" \
57
+ printf "%s\n" "${ERR_MSG_LINE}" \
58
+ exit 1; \
59
+ ;}
47
60
cd ..
48
61
- name : Get makefiles Files
49
62
id : makefiles
@@ -65,11 +78,19 @@ jobs:
65
78
run : |
66
79
TOOL_PATH=".github/tool_checkmake.sh"
67
80
if [ ! -x "$TOOL_PATH" ]; then
68
- printf "::error file=.github/workflow/makefile-lint.yml,line=66,endLine=70,title=FAILURE::ERROR %s\n" "$TOOL_PATH not found or not executable."
69
- exit 1
81
+ { \
82
+ ERR_MSG_STUB="$TOOL_PATH not found or not executable." \
83
+ ERR_DETS="file=.github/workflow/makefile-lint.yml,line=79,endLine=88,title=FAILURE" \
84
+ ERR_MSG_LINE="::error ${ERR_DETS}::ERROR ${ERR_MSG_STUB}" \
85
+ printf "%s\n" "${ERR_MSG_LINE}" \
86
+ exit 1; \
87
+ ;}
70
88
fi
71
89
FILE="${{ steps.makefiles.outputs.files }}" ;
72
90
printf "::group::%s\n" "${FILE}" ;
73
- "$TOOL_PATH" "${FILE}" || { printf "::error file=.github/workflow/makefile-lint.yml,line=73,endLine=73,title=FAILURE::ERROR %s\n" "Linting failed."; exit 1; } ;
91
+ ERR_MSG_STUB="Linting failed."
92
+ ERR_DETS="file=.github/workflow/makefile-lint.yml,line=89,endLine=97,title=FAILURE"
93
+ ERR_MSG_LINE="::error ${ERR_DETS}::ERROR ${ERR_MSG_STUB}"
94
+ "$TOOL_PATH" "${FILE}" || { printf "%s\n" "${ERR_MSG_LINE}"; exit 1; } ;
74
95
printf "::endgroup::\n" ; unset FILE 2>/dev/null || true ;
75
96
if : ${{ !cancelled() && steps.makefiles.outputs.files != '' }}
0 commit comments