@@ -75,13 +75,48 @@ jobs:
75
75
run : |
76
76
exit 1
77
77
78
- - name : Install all modules
78
+ - name : Verify all modules and update hash
79
79
run : |
80
80
for dir in ports/* ; do
81
81
echo "Test to install $dir"
82
- vcpkg install ${dir##ports/} --overlay-ports=ports
82
+ status=0
83
+ install_output=$(vcpkg install ${dir##ports/} --overlay-ports=ports) || status=$?
84
+ if [[ ! $status -eq 0 ]]; then
85
+ echo " Update hash on $dir/portfile.cmake"
86
+ expected=$(echo "$install_output" | grep -oP "(?<=Expected hash: ).{128}")
87
+ actual=$(echo "$install_output" | grep -oP "(?<=Actual hash: ).{128}")
88
+ sed -i "s@${expected}@${actual}@g" "$dir/portfile.cmake"
89
+ echo " Expected hash: ${expected}"
90
+ echo " Actual hash: ${actual}"
91
+ fi
83
92
done
84
93
94
+ - name : Detect hash changes against local
95
+ id : filter-hash
96
+ uses : dorny/paths-filter@v2
97
+ with :
98
+ list-files : shell
99
+ base : HEAD
100
+ filters : |
101
+ ports:
102
+ - ports/**
103
+
104
+ - name : Get ports last commit message
105
+ if : steps.filter-hash.outputs.ports == 'true'
106
+ id : ports-last-commit-message
107
+ run : |
108
+ echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
109
+
110
+ - name : Commit port hash
111
+ if : steps.filter-hash.outputs.ports == 'true'
112
+ uses : stefanzweifel/git-auto-commit-action@v5
113
+ with :
114
+ file_pattern : ports/*
115
+ commit_message : ${{ steps.ports-last-commit-message.outputs.msg }}
116
+ push_options : --force
117
+ commit_options : --amend --no-edit
118
+ skip_fetch : true
119
+
85
120
- name : Detect ports changes against default branch
86
121
id : filter-ports
87
122
uses : dorny/paths-filter@v2
0 commit comments