Skip to content

Keep scheduled workflows alive #2

Keep scheduled workflows alive

Keep scheduled workflows alive #2

Workflow file for this run

name: Keep scheduled workflows alive
on:
workflow_dispatch:
schedule:
- cron: 0 0 1 * *
jobs:
keepalive:
runs-on: ubuntu-22.04
steps:
- name: Disable workflows
uses: actions/github-script@v6
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
await github.rest.actions.disableWorkflow({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'push.yml',
});
- name: Enable workflows
uses: actions/github-script@v6
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
await github.rest.actions.enableWorkflow({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'push.yml',
});