You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
name: update clash-meta.yaml
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- "README.md"
|
|
- "script/**"
|
|
- "source/**"
|
|
- ".gitignore"
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: '0 */6 * * *'
|
|
|
|
jobs:
|
|
Build:
|
|
permissions: write-all
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
|
|
- name: Update Clash 1
|
|
run: |
|
|
curl -L ${{ secrets.CLASH_API }} > source/clash-meta.yaml
|
|
rand=_$(date +%s%N | md5sum |cut -c 2-6)_
|
|
sed -i "s/${{ secrets.CLASH_REPLACE }}/$rand/g" source/clash-meta.yaml
|
|
|
|
- name: Update Clash 2
|
|
run: |
|
|
curl ${{ secrets.CLASH_API_2 }} > source/clash-meta-2.yaml
|
|
curl ${{ secrets.V2RAY_API_2 }} > source/v2ray-2.txt
|
|
|
|
- name: Commit files
|
|
run: |
|
|
git config --local user.email "snakem982@gmail.com"
|
|
git config --local user.name "snakem982"
|
|
git add -A
|
|
git commit -a -m "Updated $(TZ='Asia/Shanghai' date '+%Y-%m-%d %H:%M %Z')" --allow-empty
|
|
|
|
- name: Git Push
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: ${{ github.ref }}
|
|
|