Auto Api #11584
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#自动调用api保活 | |
name: Auto Api | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
schedule: | |
- cron: 0 */2 * * * | |
watch: | |
types: [started] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.8 | |
- name: Install requests | |
run: | | |
pip install requests | |
pip install pynacl | |
- name: read config from secrets | |
env: | |
id: ${{ secrets.CONFIG_ID }} | |
secret: ${{ secrets.CONFIG_KEY }} | |
token: ${{secrets.GPT_TOKEN}} | |
refresh_token: ${{secrets.REFRESH_TOKEN}} | |
run: | | |
python main.py | |
- name: commit | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "ShermanQ" | |
git add . | |
git commit -m "update new token" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |