diff --git a/.github/workflows/auto_clean.yaml b/.github/workflows/auto_clean.yaml new file mode 100644 index 0000000..4b0f4ce --- /dev/null +++ b/.github/workflows/auto_clean.yaml @@ -0,0 +1,15 @@ +name: 'workflows日志自动清理' + +on: + schedule: + - cron: '0 0 */3 * *' + workflow_dispatch: + +jobs: + del_workflow: + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: GitRML/delete-workflow-runs@main + with: + retain_days: '3' diff --git a/.github/workflows/auto_push.yml b/.github/workflows/auto_push.yml new file mode 100644 index 0000000..a772795 --- /dev/null +++ b/.github/workflows/auto_push.yml @@ -0,0 +1,32 @@ +name: 自动push防止Actions自动停止 + +on: + workflow_dispatch: + schedule: + - cron: '0 0 1,15 * *' + repository_dispatch: + types: start_action + +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id || github.actor == 'StoneForests' + + steps: + - name: Getting the repo + uses: actions/checkout@v3 + + - name: Re setting the url for `origin` + run: | + git remote set-url origin https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git + - name: Adding git info + run: | + git config --global user.name "StoneForests" + git config --global user.email "5436513+StoneForests@users.noreply.github.com" + - name: Creating an empty commit + run: | + git commit --allow-empty -m "Auto amazing commit" + + - name: Finilly pushing the repo + run: | + git push origin master diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 410c9c3..d631646 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,11 @@ name: Run on: - workflow_dispatch: - repository_dispatch: + workflow_dispatch: + schedule: + - cron: "0 22,14 * * *" + watch: + types: [started] jobs: build: @@ -17,4 +20,4 @@ jobs: with: run: dotnet run env: - CONF: ${{ secrets.CONF }} \ No newline at end of file + CONF: ${{ secrets.CONF }} diff --git a/Program.cs b/Program.cs index 79de011..cef31b4 100644 --- a/Program.cs +++ b/Program.cs @@ -192,7 +192,7 @@ async Task Notify(string msg, bool isFailed = false) Console.WriteLine(msg); if (_conf.ScType == "Always" || (isFailed && _conf.ScType == "Failed")) { - await _scClient.GetAsync($"https://sc.ftqq.com/{_conf.ScKey}.send?text={msg}"); + await _scClient.GetAsync($"https://sctapi.ftqq.com/{_conf.ScKey}.send?title=有道云笔记签到&desp={msg}"); } }