backtrace/.github/workflows/build.yml

47 lines
1.1 KiB
YAML

name: 创建IPv6检测的前缀
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
concurrency:
group: backtrace-ipv6-prefix-sync
cancel-in-progress: false
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
permissions:
contents: write
jobs:
fetch-ipv6-prefixes:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: 设置 Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: 获取并处理多个ASN的IPv6前缀
run: |
go run ./cmd/update-prefixes -output-dir bk/prefix
- name: 提交更新到仓库
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add bk/prefix/*.txt bk/prefix/*.txt.manifest.json
if git diff --cached --quiet; then
echo "无变更,跳过提交。"
else
git commit -m "chore: 更新多个 ASN 的 IPv6 前缀"
git push
fi