{"id":16123604,"url":"https://github.com/austenstone/schedule","last_synced_at":"2025-04-14T20:32:49.061Z","repository":{"id":239381800,"uuid":"798939655","full_name":"austenstone/schedule","owner":"austenstone","description":"Schedule GitHub Actions Events to happen in the future! 📅","archived":false,"fork":false,"pushed_at":"2024-08-06T01:56:52.000Z","size":13643,"stargazers_count":9,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T08:51:15.478Z","etag":null,"topics":["actions","github"],"latest_commit_sha":null,"homepage":"https://github.com/austenstone/schedule","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/austenstone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["austenstone"]}},"created_at":"2024-05-10T19:58:40.000Z","updated_at":"2025-03-27T06:50:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"b26395d1-26bc-4506-8564-9cc8372e1931","html_url":"https://github.com/austenstone/schedule","commit_stats":null,"previous_names":["austenstone/schedule"],"tags_count":4,"template":false,"template_full_name":"austenstone/action-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fschedule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fschedule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fschedule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fschedule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austenstone","download_url":"https://codeload.github.com/austenstone/schedule/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248955995,"owners_count":21189271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","github"],"created_at":"2024-10-09T21:17:39.798Z","updated_at":"2025-04-14T20:32:49.029Z","avatar_url":"https://github.com/austenstone.png","language":"TypeScript","readme":"# 📅 Schedule Workflow Runs Action\n\nSchedule your GitHub Actions workflows to run at a future date and time! 🤯\n\nThis works using the [`schedule`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) event to poll GitHub variables which are used as our database for scheduling.\n\n\u003cdetails\u003e\n\u003csummary\u003eFlow Diagram\u003c/summary\u003e\n\n```mermaid\nflowchart LR\n    A([`workflow_dispatch`]) --\u003e H[Create scheduled workflow]\n    W([`schedule`]) ---\u003e I\n    B([`other`]) ---\u003e I\n    H --\u003e I[Fetch scheduled workflows]\n    I --\u003e P((For Each\\nscheduled\\nworkflow))\n    P --\u003e Q{Is it time to run\\nscheduled workflow?}\n    Q --\u003e |yes| R[Run scheduled workflow]\n    R --\u003e S[Delete scheduled workflow]\n    S --\u003e V{Have we waited\\n`wait-ms`?}\n    V --\u003e |no| T[Wait\\n`wait-delay-ms`]\n    T --\u003e I\n    V --\u003e |yes| U[Write job summary]\n    Q --\u003e |no| V\n```\n\n\u003c/details\u003e\n\nhttps://github.com/austenstone/schedule/assets/22425467/040aa351-cf1a-40e2-99e9-98de5de192bc\n\n## Usage\n\nCreate a workflow (eg: `.github/workflows/schedule.yml`) and copy the [example](#-example) below. Ensure you've setup the [authentication](#-authentication) and [inputs](#%EF%B8%8F-inputs) correctly.\n\n### 🔑 Authentication\n\n#### GitHub App\n\n* [Create a GitHub App](https://github.com/settings/apps/new?name=actions-scheduler\u0026description=Schedule%20GitHub%20Actions%20runs.\u0026url=https://github.com\u0026public=false\u0026actions=write\u0026actions_variables=write\u0026webhook_active=false) with the `actions` \u0026 `actions_variables` scope.\n* Use the [actions/create-github-app-token](https://github.com/actions/create-github-app-token?tab=readme-ov-file#create-github-app-token) action to create a GitHub App token to generate a token.\n\n#### Personal Access Token (PAT)\n\nYou need to create a Personal Access Token (PAT) with the `repo` scope and add it to your repository secrets.\n\n##### Fine-grained access tokens\n\nThe token must have the following permission set:\n\n* `actions_variables:write`\n* `actions:write`\n\n### ⏩ Example\n\n\u003cimg align=\"right\" src=\"https://github.com/austenstone/schedule/assets/22425467/c0e844ec-11b2-4449-919d-c03786ff066a\" width=\"250px\"\u003e\n\nThis workflow runs on a [`schedule`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) event every hour and spends \u003c1min checking the schedule for any pending workflows to run.\n\nTo schedule a workflow, manually do a [`workflow_dispatch`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch) by going to \"Actions \u003e 📅 Schedule Workflow Dispatch\", type when you want the workflow to run, and click Run workflow.\n\n#### Inputs\n\n* Replace the `workflow` input with the name, path, or id of the workflow you want to run\n* Change the `timezone` input to your timezone\n\n\u003e [!IMPORTANT]  \n\u003e Make sure you've set your PAT to the `TOKEN` secret in your repository settings.\n\n```yml\nname: 📅 Schedule Workflow Dispatch\non:\n  schedule:\n    - cron: '0 */1 * * *' # every hour\n  workflow_dispatch:\n    inputs:\n      date:\n        description: 'Date to run the workflow'\n        required: true\n        type: string\n        default: 'in 1 hour'\nconcurrency:\n  group: schedule${{ github.event.inputs.date }}\n  cancel-in-progress: true\n\njobs:\n  schedule:\n    name: 📅 Schedule\n    runs-on: ubuntu-latest\n    steps:\n      - uses: austenstone/schedule@v1.3\n        with:\n          github-token: ${{ secrets.TOKEN }}\n          date: ${{ github.event.inputs.date }}\n          workflow: 'basic.yml'\n          timezone: 'US/Eastern' # US/Central, US/Pacific\n          wait-ms: 45000\n```\n\n#### Timezone\n\nThe timezone is set to `EST` by default. You can change this to your timezone. EX: `US/Central`, `US/Pacific`, [etc](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).\n\n```yml\n          timezone: 'US/Eastern'\n```\n\n#### Changing when to check the schedule\n\nThe [`schedule`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) event is used to check for scheduled workflow runs. You can change the cron to run at a different interval.\n\n```yml\non:\n  schedule:\n    - cron: '0 */1 * * *'\n```\n\nThe action also has the ability to continue running the workflow and polling for a specific amount of time. This is useful if you want to run the workflow at a specific time and then continue running the workflow for a specific amount of time.\n\nIn the example below we spend 5 minutes checking the schedule every 20 seconds:\n\n```yml\n        with:\n          wait-ms: 300000 # Check for 5 minutes\n          wait-delay-ms: 20000 # Wait 20 seconds between checks\n```\n\n\u003e [!TIP]\n\u003e You may want to consider that for billing GitHub jobs are rounded up to the nearest minute.\n\n#### Selecting the workflow to run\n\nPass in the workflow you want to run. This can be the name, path, or id of the workflow.\n\n```yml\n          workflow: 'basic.yml'\n```\n\nYou could provide options for workflows to run. This does interfere with the workflow inputs you might want to pass in.\n\n```yml\n\n      workflow:\n        description: 'Workflow to run at schedule time'\n        required: true\n        type: choice\n        options:\n          - 'basic.yml'\n          - 'codeql.yml'\n...\n        with:\n          workflow: ${{ inputs.workflow }}\n```     \n\n#### Passing Workflow Inputs\n\nYou can provide the [`workflow_dispatch`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch) inputs you want to provide by using the `inputs` input.\n\n```yml\n        with:\n          inputs: '{\"name\": \"Austen\"}'\n```\n\nor from the inputs themselves.\n\n```yml\n        with:\n          inputs: ${{ toJson(github.event.inputs) }}\n```\n\n### ➡️ Inputs\nVarious inputs are defined in [`action.yml`](action.yml):\n\n| Name | Description | Default |\n| --- | - | - |\n| *github-token* | The GitHub token used to create an authenticated client | ${{ github.token }} |\n| *workflow* | Workflow to run at schedule time |  |\n| date | Date to run the workflow | ${{ github.event.inputs.date }} |\n| wait-ms | Milliseconds to wait | 0 |\n| wait-delay-ms | Milliseconds to wait between checks on the schedule | 20000 |\n| ref | Branch to run the workflow on | ${{ github.ref }} |\n| owner | Optional repository owner to run the workflow on. | ${{ github.repository_owner }} |\n| repo | Optional repository name to run the workflow on. | ${{ github.repository }} |\n| timezone | Timezone to use for the schedule | EST |\n| inputs | Inputs to pass to the workflow |\n| inputs-ignore | Inputs to ignore when passing to the workflow | date,workflow |\n\n\u003c!-- \n## ⬅️ Outputs\n| Name | Description |\n| --- | - |\n| output | The output. |\n--\u003e\n\n## Further help\nTo get more help on the Actions see the [documentation](https://docs.github.com/en/actions).\n","funding_links":["https://github.com/sponsors/austenstone"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustenstone%2Fschedule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustenstone%2Fschedule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustenstone%2Fschedule/lists"}