Skip to content

Commit

Permalink
Compatible to run on Windows platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
grbnb committed Nov 12, 2024
1 parent b5c7cf8 commit 645ff45
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
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'
Expand All @@ -72,13 +72,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@v2
uses: grbnb/random-workflow-cron@v1
with:
push_switch: false
time_zone: "UTC+8"
Expand Down Expand Up @@ -134,7 +134,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
Expand Down
8 changes: 4 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
keep_history: true
```

设置随机小时范围为`1-21`[UTC+8时区],每间隔15天并且一天只运行5次, 但是不立即推送提交到仓库,即工作流文件后面的步骤存在推送操作,避免多次推送!!!
设置随机小时范围为`1-21`[UTC+8时区],每间隔15天并且一天只运行7次, 但是不立即推送提交到仓库,即工作流文件后面的步骤存在推送操作,避免多次推送!!!

```yml
name: 'random-cron'
Expand All @@ -72,13 +72,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@v2
uses: grbnb/random-workflow-cron@v1
with:
push_switch: false
time_zone: "UTC+8"
Expand Down Expand Up @@ -134,7 +134,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
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ runs:
using: 'composite'
steps:
- if: ${{ inputs.push_switch == 'true' }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ inputs.github_token }}
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref_branch }}
fetch-depth: 2
- 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 }}
Expand Down

0 comments on commit 645ff45

Please sign in to comment.