Skip to content

Commit 57d4405

Browse files
committed
github-actionify: tune commit message prefix
It is now "CI: " rather than "GitHub Action: ", and it is used consistently for all commits.
1 parent aa2a07f commit 57d4405

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

github-actionify.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ credentialsDir=$HOME/.scijava/credentials
2525
varsFile=$credentialsDir/vars
2626
pomMinVersion='17.1.1'
2727
tmpFile=gitaction.tmp
28+
msgPrefix="CI: "
2829

2930
info() { echo "- $@"; }
3031
warn() { echo "[WARNING] $@" 1>&2; }
@@ -48,7 +49,7 @@ update() {
4849
file=$1
4950
msg=$2
5051
exe=$3
51-
test "$msg" || msg="GitHub Action: update $file"
52+
test "$msg" || msg="update $file"
5253
if [ -e "$file" ]
5354
then
5455
if diff -q "$file" "$tmpFile" >/dev/null
@@ -71,7 +72,7 @@ update() {
7172
info "Adding execute permission to $file"
7273
$EXEC git update-index --chmod=+x "$file"
7374
fi
74-
$EXEC git diff-index --quiet HEAD -- || $EXEC git commit -m "$msg"
75+
$EXEC git diff-index --quiet HEAD -- || $EXEC git commit -m "$msgPrefix$msg"
7576
}
7677

7778
process() {
@@ -218,7 +219,7 @@ curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/master/gith
218219
sh github-action-ci.sh
219220
EOL
220221
chmod +x "$tmpFile"
221-
update "$gitactionSetupScript" "GitHub Action: add executable script $gitactionSetupScript" "true"
222+
update "$gitactionSetupScript" "add executable script $gitactionSetupScript" "true"
222223

223224
# Add/update the GitHub Action build script.
224225
cat >"$tmpFile" <<EOL
@@ -227,7 +228,7 @@ curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/master/ci-b
227228
sh ci-build.sh
228229
EOL
229230
chmod +x "$tmpFile"
230-
update "$gitactionBuildScript" "GitHub Action: add executable script $gitactionBuildScript" "true"
231+
update "$gitactionBuildScript" "add executable script $gitactionBuildScript" "true"
231232

232233
# Remove obsolete GitHub-Actions-related files.
233234
if [ -f "$gitactionSettingsFile" ]
@@ -240,7 +241,7 @@ EOL
240241
info "Removing obsolete $gitactionNotifyScript (ImageJ Jenkins is dead)"
241242
$EXEC git rm -f "$gitactionNotifyScript"
242243
fi
243-
$EXEC git diff-index --quiet HEAD -- || $EXEC git commit -m "GitHub Action: remove obsolete files"
244+
$EXEC git diff-index --quiet HEAD -- || $EXEC git commit -m "${msgPrefix}remove obsolete files"
244245

245246
# Upgrade version of pom-scijava.
246247
if [ -z "$SKIP_PARENT_CHECK" ]
@@ -251,7 +252,7 @@ EOL
251252
then
252253
info 'Upgrading pom-scijava version'
253254
sed "s|^ <version>$version</version>$| <version>$pomMinVersion</version>|" pom.xml >"$tmpFile"
254-
update pom.xml "POM: update pom-scijava parent to $pomMinVersion"
255+
update pom.xml "update pom-scijava parent to $pomMinVersion"
255256
else
256257
info "Version of pom-scijava ($version) is OK"
257258
fi
@@ -267,7 +268,7 @@ EOL
267268
info 'Adding <releaseProfiles> property'
268269
cp pom.xml "$tmpFile"
269270
perl -0777 -i -pe 's/(\n\t<\/properties>\n)/\n\n\t\t<!-- NB: Deploy releases to the SciJava Maven repository. -->\n\t\t<releaseProfiles>deploy-to-scijava<\/releaseProfiles>\1/igs' "$tmpFile"
270-
update pom.xml 'POM: deploy releases to the SciJava repository'
271+
update pom.xml 'deploy releases to the SciJava repository'
271272
fi
272273

273274
# update the README
@@ -276,13 +277,13 @@ EOL
276277
then
277278
info "Updating README.md GitHub Action badge"
278279
sed "s;travis-ci.*;$domain/$repoSlug/actions/$gitactionConfigRoot/badge.svg)](https://$domain/$repoSlug/actions$gitactionConfigRoot);g" README.md >"$tmpFile"
279-
update README.md 'GitHub Action: fix README.md badge link'
280+
update README.md 'update README.md badge link'
280281
else
281282
info "Adding GitHub Action badge to README.md"
282283
echo "[![SciJava CI](https://$domain/$repoSlug/actions/$gitactionConfigRoot/badge.svg)](https://$domain/$repoSlug/actions/$gitactionConfigRoot)" >"$tmpFile"
283284
echo >>"$tmpFile"
284285
test -f README.md && cat README.md >>"$tmpFile"
285-
update README.md 'GitHub Action: add badge to README.md'
286+
update README.md 'add README.md badge link'
286287
fi
287288
}
288289

0 commit comments

Comments
 (0)