mirror of
https://github.com/FiorenMas/Revanced-And-Revanced-Extended-Non-Root.git
synced 2025-12-06 08:07:40 +00:00
update workflow
Workflow will retry more 2 times before stop the workflow if github connection not stable
This commit is contained in:
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@@ -4,6 +4,11 @@ on:
|
||||
schedule:
|
||||
- cron: "0 */6 * * *"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
retry_count:
|
||||
description: 'Do not change value below'
|
||||
required: false
|
||||
default: '1'
|
||||
jobs:
|
||||
check:
|
||||
name: Check new patch
|
||||
@@ -43,6 +48,29 @@ jobs:
|
||||
- name: Keep workflow run
|
||||
if: steps.check-gh.outputs.internet_error == '0'
|
||||
uses: gautamkrishnar/keepalive-workflow@v1
|
||||
- name: Re-run workflow if github connection not stable
|
||||
if: always() && steps.check-rv.outcome == 'skipped' && env.retry_count < env.max_retries
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const maxRetries = ${{ env.max_retries }};
|
||||
let retryCount = ${{ env.retry_count }};
|
||||
if (retryCount < maxRetries) {
|
||||
retryCount += 1;
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: "ci.yml",
|
||||
ref: context.ref,
|
||||
inputs: {
|
||||
'retry_count': String(retryCount)
|
||||
}
|
||||
});
|
||||
}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
retry_count: ${{ github.event.inputs.retry_count }}
|
||||
max_retries: 3
|
||||
outputs:
|
||||
check_rv: ${{ steps.check-rv.outputs.new_patch }}
|
||||
check_rv_beta: ${{ steps.check-rv-beta.outputs.new_patch }}
|
||||
|
||||
Reference in New Issue
Block a user