Revanced-And-Revanced-Exten.../.github/actions/re-run/action.yml
2026-03-28 00:27:53 +07:00

24 lines
No EOL
860 B
YAML

name: Re-run workflow if github connection not stable
runs:
using: "composite"
steps:
- name: Re-run workflow if github connection not stable
uses: actions/github-script@v8.0.0
with:
script: |
const maxRetries = ${{ env.max_retries }};
let retryCount = Number('${{ env.retry_count }}');
const orgInput = '${{ env.org_event_input }}' || '${{ env.org_input }}';
if (retryCount < maxRetries) {
retryCount += 1;
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "manual-patch.yml",
ref: context.ref,
inputs: {
'retry_count': String(retryCount),
'org': orgInput
}
});
}