Skip to content

Auto check in sockboom GH #280

Auto check in sockboom GH

Auto check in sockboom GH #280

Workflow file for this run

name: 'Auto check in sockboom GH'
on:
release:
types: [published]
push:
tags:
- 'v*'
schedule:
- cron: '00 19 * * *' # UTC+8小时=北京时间 19代表凌晨三点
watch:
types: [started]
jobs:
checking:
runs-on: ubuntu-latest
# if: github.event.repository.owner.id == github.event.sender.id # 自己点的 start
steps:
- name: Setup timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Asia/Shanghai
- name: Get log
uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install bs4
- name: checkin
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
BARK: ${{ secrets.BARK }}
run: |
curl -X POST "$BARK" -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" -d "title=SockBoom CheckIn&body=$(python3 checkin.py --email $EMAIL --p $PASSWORD)&group=sockboom"
# - name: login in APi #登录获取cookie
# env:
# EMAIL: ${{ secrets.EMAIL }}
# PASSWORD: ${{ secrets.PASSWORD }}
# run: |
# echo -en $(curl -c cookie.txt -X POST 'https://sockboom.id/auth/login' -d email="$EMAIL" -d passwd="$PASSWORD")
# - name: Chick in Api #签到
# env:
# BARK: ${{ secrets.BARK }}
# run: |
# echo -n `date +%Y-%m-%d\ %H:%M:%S`\ -\ >> ./run.log
# echo -e $(curl -b cookie.txt -X POST 'https://sockboom.id/user/checkin') >> ./run.log
# tail run.log #避免日志上传失败丢失日志
# curl -X POST "$BARK" -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" -d "title=SockBoom CheckIn&body=$(tail ./run.log)&group=sockboom"
# - name: Commit #上传日志到仓库,可以自行修改 name 和 email
# env:
# NAME: bot
# EMAIL: bot@sockboom.com
# run: |
# git config --global user.name "$NAME"
# git config --global user.email "$EMAIL"
# git add .
# git commit -m "bot checkin"
# - name: Push log
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.TOKEN }}