Replace data in .module Files #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Replace data in .module Files | |
on: | |
workflow_dispatch: | |
# schedule: | |
# - cron: "30 * * * *" | |
permissions: | |
actions: write | |
contents: write | |
jobs: | |
replace-date: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
repository: sooyaaabo/Egern | |
path: Egern | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set timezone to China/Shanghai | |
run: | | |
sudo timedatectl set-timezone Asia/Shanghai | |
- name: Find and update .module files | |
run: | | |
cd Egern | |
# 查找所有的 .module 文件 | |
find . -name "*.module" -print0 | while IFS= read -r -d '' file; do | |
# 删除特定行并替换首页 | |
sed -i '/#!loon_version=3.2.5(805)/d' "$file" | |
sed -i 's|#!homepage=https://github.com/sooyaaabo/Loon/blob/main/README.md|#!homepage=https://github.com/sooyaaabo/Egern|' "$file" | |
done | |
- name: Commit changes | |
run: | | |
cd Loon | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "Routine Updates" || echo "No changes to commit" | |
git push |