Skip to content

Commit

Permalink
Create testApi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zhtok authored Feb 23, 2023
1 parent daec409 commit 3f59c67
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/testApi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: TestAutoSubscribeService

on:
release:
types: [published]
push:
branches:
- master
schedule:
- cron: '12 */3 * * *'
watch:
types: [started]

jobs:
Task:
runs-on: ubuntu-22.04
if: github.event.repository.owner.id == github.event.sender.id # 自己点的 start
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Python #安装python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install requests #安装requests
run: |
pip install requests
- name: Read config from secrets #读取机密
env:
CONFIG_ID: ${{ secrets.CONFIG_ID }} # secrets_id 提供
CONFIG_KEY: ${{ secrets.CONFIG_KEY }} # secrets_key 提供
run: |
cp test.py 2.py
echo $CONFIG_ID > configid.txt
echo $CONFIG_KEY > configkey.txt
sed -i '10 r configid.txt' 2.py
sed -i '12 r configkey.txt' 2.py
- name: Test Api #Api调用
run: |
echo `date +"%Y-%m-%d %H:%M:%S"` begin > time.log
python 2.py
- name: Delete secrets config #删除机密
run: |
rm -f 2.py
rm -f configid.txt
rm -f configkey.txt
- name: Commit #上传新的refresh_token到仓库
run: |
git config --global user.email testApi@chrisvcg.top
git config --global user.name testApiBot
git add .
git commit -m "update new refresh token with testApiBot" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

1 comment on commit 3f59c67

@zhtok
Copy link
Owner Author

@zhtok zhtok commented on 3f59c67 Feb 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitAction skip problem fixed.

Please sign in to comment.