File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Replace Version Text-Safe
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - main
8+
9+ jobs :
10+ replace-version :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v3
15+
16+ - name : Ultra-precise text-only replacement
17+ run : |
18+ echo "Replacing all 0.1.3 → 0.2.0 in text/code files only..."
19+ # Find files excluding .git/.github
20+ find . -type f ! -path "*/.git/*" ! -path "*/.github/*" -print0 | while IFS= read -r -d '' file; do
21+ # Only process text files
22+ if file --mime "$file" | grep -q 'charset='; then
23+ perl -pi -e 's/(^|[^0-9])0\.1\.3([^0-9]|$)/$1.2.0$2/g' "$file"
24+ fi
25+ done
26+
27+ - name : Show changed files
28+ run : git status
29+
30+ - name : Commit & push
31+ run : |
32+ git config user.name "github-actions[bot]"
33+ git config user.email "github-actions[bot]@users.noreply.github.com"
34+ git add .
35+ git commit -m "Text-safe update: 0.1.3 → 0.2.0" || echo "No changes to commit"
36+ git push
You can’t perform that action at this time.
0 commit comments