Skip to content

Commit a48e235

Browse files
committed
chore(dc-init): update workflows and actions
1 parent ae2d839 commit a48e235

6 files changed

Lines changed: 692 additions & 23 deletions

File tree

.github/workflows/anglicise.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
private-key: ${{ secrets['XB_PK'] }}
2929

3030
- name: Setup bot identity
31-
uses: XAOSTECH/dev-control/.github/actions/identity@main
31+
uses: XAOSTECH/dev-control/.github/actions/identity@b067f72ca7f849b734a45634f23581a739d5146f # v2.0.0
3232
with:
3333
gpg-private-key: ${{ secrets['XB_GK'] }}
3434
gpg-passphrase: ${{ secrets['XB_GP'] }}
@@ -297,6 +297,7 @@ jobs:
297297
plows|ploughs|plow → plough
298298
plowed|ploughed|plow → plough
299299
plowing|ploughing|plow → plough
300+
license|licence|license → licence
300301
WORDLIST
301302
302303
# Find files to check
@@ -306,7 +307,8 @@ jobs:
306307
! -path "./vendor/*" \
307308
! -path "./.github/workflows/*" \
308309
! -path "./workflows-templates/anglicise.yml" \
309-
! -path "./license-templates/*" \
310+
! -path "./licence-templates/*" \
311+
! -path "./LICENSE" \
310312
2>/dev/null | sort)
311313
312314
echo "## British English Spelling Check" >> $GITHUB_STEP_SUMMARY
@@ -334,7 +336,7 @@ jobs:
334336
# - Variable references ($color, ${color})
335337
# - Assignment patterns (color=, COLOR=) including query params
336338
MATCHES=$(grep -inw "$american" "$file" 2>/dev/null | \
337-
grep -vE '(https?://|file://|[?&](color|center|gray)=[a-zA-Z0-9]+|"Authorization": "Bearer|types:[[:space:]]*\[[^]]+\]|--[a-z-]+ (center|color|gray)|\$\{?(color|center|gray)|}|\b(color|center|gray)[_A-Z]*=|gum |\\$)' || true)
339+
grep -vE '(https?://|file://|github/|[?&](color|center|gray|licence)=[a-zA-Z0-9]+|"Authorization": "Bearer|types:[[:space:]]*\[[^]]+\]|--[a-z-]+ (center|color|gray)|\$\{?(color|center|gray);}|\b(color|center|gray|licence)[_A-Z]*=|gum |\\$|shields\.io)' || true)
338340
339341
if [[ -n "$MATCHES" ]]; then
340342
FILES_TO_FIX["$file"]=1
@@ -390,7 +392,8 @@ jobs:
390392
! -path "./vendor/*" \
391393
! -path "./.github/workflows/*" \
392394
! -path "./workflows-templates/anglicise.yml" \
393-
! -path "./license-templates/*" \
395+
! -path "./licence-templates/*" \
396+
! -path "./LICENSE" \
394397
2>/dev/null)
395398
396399
FIXED_COUNT=0
@@ -416,26 +419,26 @@ jobs:
416419
# - Escaped line continuations (trailing backslash)
417420
# NOTE: filename exclusion is handled in the perl regex via (?!\.)
418421
# so that 'colors' in a comment is fixed even if 'colours.sh' appears on the same line
419-
if echo "$line" | grep -qE "(=[\"'](center|color)|types:[[:space:]]*\[[^]]+\]|--[a-z-]+ (center|color|gray)|--color|--center|\\$\\{?(color|center|gray)|\\b(COLOR|CENTER|GRAY)[_A-Z]*=|gum |\\\\$)"; then
422+
if echo "$line" | grep -qE "(https?://|github/|[?&](color|center|gray|licence)=|=[\"'](center|color|licence)|types:[[:space:]]*\[[^]]+\]|--[a-z-]+ (center|color|gray)|--color|--center|\$\{?(color|center|gray|licence)|\b(COLOR|CENTER|GRAY|LICENCE)[_A-Z]*=|gum |\\$|shields\.io)"; then
420423
echo "$line"
421424
else
422425
# Apply case-preserving replacement using perl
423426
# (?!\.) prevents replacing when the word is directly followed by a dot (e.g. colors.sh)
424427
echo "$line" | perl -pe "
425-
s/\\b${american}\\b(?!\\.)/
428+
s{\b${american}\b(?!\.)(?![a-zA-Z0-9]|/|=)}{
426429
my \$match = \$&;
427430
my \$repl = '${british}';
428-
if (\$match =~ \/^[A-Z]+\$\/) {
431+
if (\$match =~ /^[A-Z]+\$/) {
429432
# ALL CAPS
430433
uc(\$repl);
431-
} elsif (\$match =~ \/^[A-Z]\/) {
434+
} elsif (\$match =~ /^[A-Z]/) {
432435
# Title Case
433436
ucfirst(\$repl);
434437
} else {
435438
# lowercase
436439
\$repl;
437440
}
438-
/gei"
441+
}gei"
439442
fi
440443
done < "$file" > "$tmpfile"
441444
@@ -452,7 +455,7 @@ jobs:
452455
453456
# Check if file contains the word (case-insensitive, whole word)
454457
# Exclude lines where the match is inside a code/CLI pattern (filename exclusion handled by perl (?!\.))
455-
if grep -inw "$american" "$file" 2>/dev/null | grep -qvE "(https?://|[?&](color|center|gray)=[a-zA-Z0-9]+|\"Authorization\": \"Bearer|types:[[:space:]]*\[[^]]+\]|=[\"'](center|color)|--[a-z-]+ (center|color|gray)|--color|--center|\\$\\{?(color|center|gray)|\\b(COLOR|CENTER|GRAY)[_A-Z]*|gum |\\\\$)"; then
458+
if grep -inw "$american" "$file" 2>/dev/null | grep -qvE "(https?://|file://|github/|[?&](color|center|gray|licence)=[a-zA-Z0-9]+|\"Authorization\": \"Bearer|types:[[:space:]]*\[[^]]+\]|=[\"'](center|color|licence)|--[a-z-]+ (center|color|gray)|--color|--center|\$\{?(color|center|gray|licence)|\b(COLOR|CENTER|GRAY|LICENCE)[_A-Z]*|gum |\\$|shields\.io)"; then
456459
case_preserve_replace "$file" "$american" "$british"
457460
echo " ✓ Fixed in: $file"
458461
FIXED_COUNT=$((FIXED_COUNT + 1))
@@ -465,7 +468,7 @@ jobs:
465468
- name: Setup bot identity (if fixes needed)
466469
id: import_gpg
467470
if: steps.check.outputs.needs_fix == 'true'
468-
uses: XAOSTECH/dev-control/.github/actions/identity@main
471+
uses: XAOSTECH/dev-control/.github/actions/identity@b067f72ca7f849b734a45634f23581a739d5146f # v2.0.0
469472
with:
470473
gpg-private-key: ${{ secrets['XB_GK'] }}
471474
gpg-passphrase: ${{ secrets['XB_GP'] }}

.github/workflows/bash-lint-advanced.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175

176176
- name: Setup bot identity for signing
177177
id: identity
178-
uses: XAOSTECH/dev-control/.github/actions/identity@main
178+
uses: XAOSTECH/dev-control/.github/actions/identity@b067f72ca7f849b734a45634f23581a739d5146f # v2.0.0
179179
with:
180180
gpg-private-key: ${{ secrets['XB_GK'] }}
181181
gpg-passphrase: ${{ secrets['XB_GP'] }}

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
token: ${{ steps.app_token.outputs.token }}
149149

150150
- name: Setup bot identity
151-
uses: XAOSTECH/dev-control/.github/actions/identity@main
151+
uses: XAOSTECH/dev-control/.github/actions/identity@b067f72ca7f849b734a45634f23581a739d5146f # v2.0.0
152152
with:
153153
gpg-private-key: ${{ secrets['XB_GK'] }}
154154
gpg-passphrase: ${{ secrets['XB_GP'] }}
@@ -355,7 +355,7 @@ jobs:
355355
- name: Setup bot identity (for signing)
356356
id: import_gpg
357357
if: github.event_name == 'workflow_dispatch'
358-
uses: XAOSTECH/dev-control/.github/actions/identity@main
358+
uses: XAOSTECH/dev-control/.github/actions/identity@b067f72ca7f849b734a45634f23581a739d5146f # v2.0.0
359359
with:
360360
gpg-private-key: ${{ secrets['XB_GK'] }}
361361
gpg-passphrase: ${{ secrets['XB_GP'] }}
@@ -403,7 +403,7 @@ jobs:
403403
version: ${VERSION}
404404
description: "Version ${VERSION}"
405405
homepage: https://github.com/$GITHUB_REPOSITORY
406-
license: GPL-3.0-or-later
406+
licence: GPL-3.0-or-later
407407
entry_point: ./dc
408408
include:
409409
- scripts/

.github/workflows/replace.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
private-key: ${{ secrets['XB_PK'] }}
4040

4141
- name: Setup bot identity
42-
uses: XAOSTECH/dev-control/.github/actions/identity@main
42+
uses: XAOSTECH/dev-control/.github/actions/identity@b067f72ca7f849b734a45634f23581a739d5146f # v2.0.0
4343
with:
4444
gpg-private-key: ${{ secrets['XB_GK'] }}
4545
gpg-passphrase: ${{ secrets['XB_GP'] }}
@@ -137,7 +137,7 @@ jobs:
137137
- name: Setup bot identity (if replacement needed)
138138
id: import_gpg
139139
if: steps.replace.outputs.needs_pr == 'true'
140-
uses: XAOSTECH/dev-control/.github/actions/identity@main
140+
uses: XAOSTECH/dev-control/.github/actions/identity@b067f72ca7f849b734a45634f23581a739d5146f # v2.0.0
141141
with:
142142
gpg-private-key: ${{ secrets['XB_GK'] }}
143143
gpg-passphrase: ${{ secrets['XB_GP'] }}

0 commit comments

Comments
 (0)