Skip to content

Update run.yml

Update run.yml #2

Workflow file for this run

name: serv00 login

Check failure on line 1 in .github/workflows/main.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yaml

Invalid workflow file

`schedule` accepts a list of one or more maps with the `cron` key set
on:
schedule:
workflow_dispatch:
jobs:
ssh-execution:
runs-on: ubuntu-latest
steps:
- name: Install SSH client
run: sudo apt-get update && sudo apt-get install -y openssh-client
- name: SSH and Run Script
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
script_stop: true
script: |
echo "Starting SSH script execution..."
IP=$(echo "$SSH_CLIENT" | awk '{ print $1 }')
time=$(TZ='Asia/Shanghai' date +"%Y-%m-%d %H:%M:%S")
user=$(whoami)
TITLE="serv00 服务器登录提醒"
CONTENT="用户:${user},登录了 serv00 服务器<br/>登录 IP:${IP}<br/>登录时间:${time}"
URL="https://www.pushplus.plus/send/"
TOKEN="${{ secrets.PUSHPLUS_TOKEN }}"
response=$(curl -s -X POST -d "token=$TOKEN&title=$TITLE&content=$CONTENT" "$URL")
echo "$response"
exit