2024-07-14 08:56:20 +00:00
|
|
|
name: saltwood-wf
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ] # 触发分支
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
updatecache:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: updatecache
|
|
|
|
env:
|
2024-07-14 15:36:28 +00:00
|
|
|
TOKEN: ${{ secrets.SALTWOOD_SECRET }}
|
2024-07-14 08:56:20 +00:00
|
|
|
run: |
|
|
|
|
# 构建 URL
|
2024-08-11 13:55:51 +00:00
|
|
|
URL="https://saltwood.top:9393/93AtHome/update_files?token=$TOKEN"
|
2024-07-14 08:56:20 +00:00
|
|
|
|
|
|
|
# 使用 curl 发送
|
|
|
|
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}\n" $URL)
|
|
|
|
|
|
|
|
# 检查状态码
|
|
|
|
if [ "$RESPONSE_CODE" -eq 204 ]; then
|
|
|
|
echo "╰(*°▽°*)╯ All OK!"
|
|
|
|
else
|
|
|
|
echo "(┬┬﹏┬┬) Unexpected response code: $RESPONSE_CODE"
|
|
|
|
exit 1
|
2024-07-14 15:36:28 +00:00
|
|
|
fi
|