mirror of
https://git.fightbot.fun/hxuanyu/BingPaper.git
synced 2026-02-15 07:29:33 +08:00
GitHub Actions: 替换通知环境变量来源为 secrets,并支持基于数字的延迟指令解析
This commit is contained in:
10
.github/workflows/verify.yml
vendored
10
.github/workflows/verify.yml
vendored
@@ -42,15 +42,19 @@ jobs:
|
|||||||
- name: Notification
|
- name: Notification
|
||||||
if: success()
|
if: success()
|
||||||
env:
|
env:
|
||||||
NOTIFY_CURLS: ${{ vars.NOTIFY_CURLS }}
|
NOTIFY_CURLS: ${{ secrets.NOTIFY_CURLS }}
|
||||||
run: |
|
run: |
|
||||||
if [ -n "$NOTIFY_CURLS" ]; then
|
if [ -n "$NOTIFY_CURLS" ]; then
|
||||||
printf "%s\n" "$NOTIFY_CURLS" | while read -r line; do
|
printf "%s\n" "$NOTIFY_CURLS" | while read -r line; do
|
||||||
if [ -n "$line" ]; then
|
if [ -n "$line" ]; then
|
||||||
echo "Executing: $line"
|
if [[ "$line" =~ ^[0-9] ]]; then
|
||||||
if [[ "$line" == curl* ]]; then
|
echo "Pausing for $line ms..."
|
||||||
|
sleep "$(awk "BEGIN {print $line/1000}")" || true
|
||||||
|
elif [[ "$line" == curl* ]]; then
|
||||||
|
echo "Executing: $line"
|
||||||
eval "$line -w \"\\nHTTP Status: %{http_code}\\n\"" || true
|
eval "$line -w \"\\nHTTP Status: %{http_code}\\n\"" || true
|
||||||
else
|
else
|
||||||
|
echo "Executing: $line"
|
||||||
eval "$line" || true
|
eval "$line" || true
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user