CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 00:52:47 GMT
server: Fly/6f91d33b9d (2025-10-08)
content-type: text/html; charset=utf-8
content-encoding: gzip
via: 2 fly.io, 2 fly.io
fly-request-id: 01K78C31Y9JNNF5R1CZ5MG1AA2-bom
Running different steps on a schedule | Simon Willison’s TILs
Running different steps on a schedule
Say you have a workflow that runs hourly, but once a day you want the workflow to run slightly differently - without duplicating the entire workflow.
Thanks to @BrightRan, here's the solution. Use the following pattern in an if:
condition for a step:
github.event_name == 'schedule' && github.event.schedule == '20 17 * * *'
Longer example:
name: Fetch updated data and deploy
on:
push:
schedule:
- cron: '5,35 * * * *'
- cron: '20 17 * * *'
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
# ...
- name: Download existing .db files
if: |-
!(github.event_name == 'schedule' && github.event.schedule == '20 17 * * *')
env:
DATASETTE_TOKEN: ${{ secrets.DATASETTE_TOKEN }}
run: |-
datasette-clone https://biglocal.datasettes.com/ dbs -v --token=$DATASETTE_TOKEN
Related
- github-actions Conditionally running a second job in a GitHub Actions workflow - 2022-07-11
- github-actions Deploying a live Datasette demo when the tests pass - 2022-03-27
- github-actions Commit a file if it changed - 2020-04-19
- github-actions Only run GitHub Action on push to master / main - 2020-04-19
- github-actions Set environment variables for all steps in a GitHub Action - 2020-04-19
- github-actions Running tests against multiple versions of a Python dependency in GitHub Actions - 2023-09-15
- github-actions GitHub Actions job summaries - 2022-05-17
- github-actions GitHub Actions, Issues and Pages to build a daily planner - 2024-01-01
- github-actions Dump out all GitHub Actions context - 2020-04-19
- github-actions Running tests against PostgreSQL in a service container - 2021-02-23
Created 2020-04-20T07:39:39-07:00, updated 2020-04-20T09:24:01-07:00 · History · Edit