Update adss #76
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
# Description: Update ADSS Rules using GitHub Actions | |
# | |
# This is free software, licensed under the GPL v3 License. | |
# See /LICENSE for more information. | |
name: 镜像同步 | |
env: | |
TZ: Asia/Shanghai | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
synchronization: | |
name: 镜像同步 | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
contents: write | |
steps: | |
- name: CheckOut | |
uses: actions/checkout@v4 | |
- name: Set TimeZone | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo timedatectl set-timezone "$TZ" | |
- name: Update Mirrors To Other Repos | |
run: | | |
rm -rf .git/ | |
git init | |
git config --local user.name "Clion" | |
git config --local user.email "clion007@126.com" | |
git remote add origin "https://clion007:${{ secrets.GITCODE_TOKEN }}@gitcode.net/clion007/adss.git" | |
git checkout --orphan master | |
git add * | |
git commit -am "Auto update at $(TZ=UTC-8 date +"%Y-%m-%d %H:%M")" | |
git push --force --set-upstream origin master | |
- name: Delete Workflow Runs | |
uses: Mattraks/delete-workflow-runs@main | |
continue-on-error: true | |
with: | |
retain_days: 0 | |
keep_minimum_runs: 5 |