Skip to content

How to setup github actions to run my python script on schedule? #26539

Discussion options

You must be logged in to vote

Hi @piyushke ,

Thank you for being here! To answer your query:

  1. You need to create a workflow yaml, doc here: https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#creating-a-workflow-file

  2. In the yaml, set ‘schedule’ event. Details here. code sample as below:

    name: py
on:
  schedule:
    - cron: "0 0 * * *" #runs at 00:00 UTC everyday

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: checkout repo content
        uses: actions/checkout@v2 # checkout the repository content to github runner.
      - name: setup python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8 #install the python needed…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hkalya
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants