forked from TurboWarp/scratch-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1016 Bytes
/
replace.yml
File metadata and controls
41 lines (33 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Replace MyScratchBlocks With SnapLabs
permissions:
contents: write
on:
workflow_dispatch:
jobs:
replace:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Replace text (case-insensitive, ignoring .git and .github)
run: |
# Find all files except those inside .git or .github
find . \
-type f \
-not -path "./.git/*" \
-not -path "./.github/*" \
| while read file; do
# Replace any-case MyScratchBlocks with SnapLabs
sed -i 's/MyScratchBlocks/SnapLabs/gI' "$file"
done
- name: Commit changes
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add -A
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "Replace MyScratchBlocks with SnapLabs (case-insensitive)"
git push
fi