Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some potential bugs #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,36 @@ name: "Daily Fudan"

on:
schedule: # scheduled at (UTC+8) everyday
- cron: "14 17 * * *"
- cron: "36 10 * * *"
- cron: "0 11 * * *"
- cron: "0 23 * * *"
workflow_dispatch:

env:
RUN_ENV: 'prod'
TZ: 'Asia/Shanghai'
FUCK_GH_PAT: ${{ secrets.GH_PAT }}


permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'

steps:
- name: Checkout master with GH_PAT
if: ${{ env.FUCK_GH_PAT }}
uses: actions/checkout@v2
with:
fetch-depth: 2
ref: main
token: ${{ secrets.GH_PAT }}

- name: Checkout master without GH_PAT
if: ${{ !env.FUCK_GH_PAT }}
uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
fetch-depth: 0
ref: main

- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: edit_actions.py
if: ${{ env.FUCK_GH_PAT }}
run: python3 ./edit_actions.py '${{ secrets.SCHEDULE }}'

- name: run.py
python-version: "3.10"
- name: auto edit everyday
run: python3 ./edit.py
- name: daily fudan
run: python3 ./run.py '${{ secrets.FUDAN }}'
- name: push
run: |
git config user.name 'Github Actions'
git config user.email '[email protected]'
git add .
git commit -m 'update by github actions'
git push
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ dmypy.json

# Pyre type checker
.pyre/

.idea/
5 changes: 5 additions & 0 deletions edit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import random

if __name__ == '__main__':
with open("trash", 'w') as f:
f.write(str(random.Random().random()))
141 changes: 0 additions & 141 deletions edit_actions.py

This file was deleted.

124 changes: 0 additions & 124 deletions git_base.py

This file was deleted.

4 changes: 2 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from git_base import *
from sys import exit as sys_exit

daily_fudan_core = r'https://github.com/Limour-dev/daily_fudan_core.git'
daily_fudan_actions = r'https://github.com/Limour-dev/daily_fudan_actions.git'
daily_fudan_core = r'https://github.com/Ricardo-Evans/daily_fudan_core.git'
daily_fudan_actions = r'https://github.com/Ricardo-Evans/daily_fudan_actions.git'

try_call(git_add_upstream, daily_fudan_core)

Expand Down
Empty file added trash
Empty file.