From 45073a0d0c041c15a763b48eba48405cc9df2587 Mon Sep 17 00:00:00 2001 From: grbnb <91207071+grbnb@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:57:38 +0800 Subject: [PATCH] Compatible to run on Windows platforms --- README.md | 16 ++++++++-------- README_zh.md | 16 ++++++++-------- action.yml | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index cafff7d..3c2c71f 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} fetch-depth: 2 - name: Random Cron - uses: grbnb/random-workflow-cron@dev + uses: grbnb/random-workflow-cron@v1 with: keep_history: true ``` @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} repository: ${{ github.repository }} @@ -62,14 +62,14 @@ jobs: fetch-depth: 2 - name: Random Cron - uses: grbnb/random-workflow-cron@dev + uses: grbnb/random-workflow-cron@v1 with: workflow_name: ".github/workflows/ci.yml" ref_branch: dev keep_history: true ``` -Set the random hour range to `1-21` [UTC+8 time zone], running only 5 times a day every 15 days, but not immediately pushing and commit to the repository. This means that there are push operations in the steps after the workflow file, avoiding multiple push operations!!! +Set the random hour range to `1-21` [UTC+8 time zone], running only 7 times a day every 15 days, but not immediately pushing and commit to the repository. This means that there are push operations in the steps after the workflow file, avoiding multiple push operations!!! ```yml name: 'random-cron' @@ -84,12 +84,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} - name: Random Cron - uses: grbnb/random-workflow-cron@dev + uses: grbnb/random-workflow-cron@v1 with: push_switch: false time_zone: "UTC+8" @@ -145,7 +145,7 @@ Error: Invalid exit code: 128 Add GitHub API `token` key to your workflow yml file at `uses: actions/checkout@v3` in step ```yml - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} fetch-depth: 2 diff --git a/README_zh.md b/README_zh.md index 00a0d39..fbad64e 100644 --- a/README_zh.md +++ b/README_zh.md @@ -28,13 +28,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} fetch-depth: 2 - name: Random Cron - uses: grbnb/random-workflow-cron@dev + uses: grbnb/random-workflow-cron@v1 with: github_token: ${{ secrets.PAT }} keep_history: true @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} repository: ${{ github.repository }} @@ -63,7 +63,7 @@ jobs: fetch-depth: 2 - name: Random Cron - uses: grbnb/random-workflow-cron@dev + uses: grbnb/random-workflow-cron@v1 with: workflow_name: ".github/workflows/ci.yml" github_token: ${{ secrets.PAT }} @@ -71,7 +71,7 @@ jobs: keep_history: true ``` -设置随机小时范围为`1-21`[UTC+8时区],每间隔15天并且一天只运行5次, 但是不立即推送提交到仓库,即工作流文件后面的步骤存在推送操作,避免多次推送!!! +设置随机小时范围为`1-21`[UTC+8时区],每间隔15天并且一天只运行7次, 但是不立即推送提交到仓库,即工作流文件后面的步骤存在推送操作,避免多次推送!!! ```yml name: 'random-cron' @@ -86,12 +86,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} - name: Random Cron - uses: grbnb/random-workflow-cron@dev + uses: grbnb/random-workflow-cron@v1 with: push_switch: false time_zone: "UTC+8" @@ -147,7 +147,7 @@ Error: Invalid exit code: 128 添加GitHub API `token`密钥到工作流yml文件的`uses:actions/checkout@v3`步骤中 ```yml - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} fetch-depth: 2 diff --git a/action.yml b/action.yml index 503731e..d66e4f5 100644 --- a/action.yml +++ b/action.yml @@ -54,7 +54,7 @@ runs: using: 'composite' steps: - shell: bash - run: bash ${{ github.action_path }}/cron.sh + run: bash "${{ github.action_path }}/cron.sh" env: workflow_name: ${{ inputs.workflow_name }} push_switch: ${{ inputs.push_switch }}