Github actions doesn't run scheduled workflow #185355
-
Why are you starting this discussion?Question What GitHub Actions topic or product is this about?General Discussion DetailsHello GitHub Community, I'm experiencing an issue where my test scheduled GitHub Actions workflow is not triggering automatically. Despite having set up the cron job correctly, it only works when manually triggered. Here are the details of my setup: name: Update Configs From Telegram
on:
workflow_dispatch:
schedule:
- cron: "0 */1 * * *"
permissions:
contents: write
jobs:
run-finder:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install --no-cache-dir pyrogram tgcrypto requests jdatetime pytz
- name: Decrypt Telegram session securely
env:
SESSION_KEY: ${{ secrets.TELEGRAM_SESSION_KEY }}
run: |
set -e
umask 077
openssl enc -aes-256-cbc -d \
-salt \
-md md5 \
-in my_accountb.session.aes256 \
-out my_accountb.session \
-pass env:SESSION_KEY
- name: Run finder
run: |
python finder.py
- name: Commit updated configs.txt
run: |
if git diff --quiet configs.txt; then
echo "No changes to configs.txt"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add configs.txt
git commit -m "chore: update configs.txt [auto]"
git push origin main
- name: cleanup
if: always()
run: |
if [ -f my_accountb.session ]; then
shred -u my_accountb.session
fiHere is the repo link if you want to check it out: https://github.com/mohammmdmdmkdmewof/v2rayConfigsForYou Permissions and Settings: Despite all these configurations, the cron job does not trigger automatically. I've ensured that the file is in the correct directory and pushed all changes to the main branch. Thank you in advance for your assistance. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
|
It looks like your workflow setup is mostly correct, but a few common issues can prevent scheduled workflows from running automatically: Default branch – Scheduled workflows only run on the default branch. You mentioned main is your default branch, so this should be fine, but double-check that your workflow file (.github/workflows/...) is indeed on main. Workflow filename and location – Make sure the workflow YAML file is in .github/workflows/ and committed to the default branch. Cron schedule syntax – Your cron: "0 */1 * * *" should run every hour at minute 0, which is valid. Just note that cron uses UTC, so check the time difference if it seems like it’s not triggering. Repository activity – If the repository is empty or inactive, GitHub sometimes delays scheduled workflows. Adding a recent commit can help. Check Actions logs – Go to the Actions tab → your workflow → Scheduled events. Sometimes GitHub logs skipped runs with reasons like "Workflow run skipped because of workflow filters" or "cron not triggered yet". Permissions – Your workflow has contents: write, which is fine for commits. Just ensure GitHub Actions is enabled for the repo and the workflow is not disabled. If everything above is correct, the next step is to manually trigger the workflow once via workflow_dispatch. After that, scheduled runs usually start firing automatically. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the details. Since your workflow is in the right location on the default branch and all runs have been manual, it’s likely hitting one of the common limitations for scheduled workflows: Free accounts or inactive repositories – Scheduled workflows don’t trigger in forked repositories or private repos without recent activity on free accounts. Make sure your repo isn’t a fork and has recent commits. GitHub Actions billing or plan limits – If Actions minutes or workflow runs are restricted on your plan, scheduled jobs may not trigger. Workflow syntax issue – Although your YAML looks correct, sometimes adding workflow_run or branches: under schedule: helps explicitly target the default branch: schedule:
Manual trigger requirement – Some workflows only start scheduled runs after at least one manual workflow_dispatch run, which you’ve done, so that should be fine. Debugging further – Try enabling workflow logs for all events by temporarily adding: on: This can sometimes force GitHub to recognize the scheduled workflow. If none of these work, it may be a GitHub backend issue, and filing a support ticket here is recommended: GitHub Support |
Beta Was this translation helpful? Give feedback.
-
|
One very common reason scheduled workflows don’t run automatically is that GitHub cron schedules only trigger on the repository’s default branch and only after the workflow file already exists on that branch. A few things to double-check: • The workflow file must already be present on main before the scheduled time. • Scheduled workflows can be delayed or skipped if there has been no repository activity for some time (GitHub may throttle inactive repos). • Cron schedules run in UTC time, not local time — so 0 */1 * * * may not match when you expect. • GitHub does not guarantee exact timing for schedule; runs can be delayed by several minutes. A good test is to: • Push a small commit to main • Wait for the next UTC hour • Check the Actions → Scheduled run history If it still doesn’t trigger after that, it’s likely due to GitHub’s scheduling throttling rather than a config issue. |
Beta Was this translation helpful? Give feedback.
-
|
👋 Thank you for reporting the issue with scheduled workflows not triggering. We identified a related change from last week that was rolled back today. Any commit pushed to the default branch will resync the impacted scheduled workflows and resolve any scheduling issues you may be experiencing. If you continue to experience issues with syncing schedules, please reply with a comment including the following:
Note: Schedules that run during periods of high load (e.g., midnight UTC) may be delayed or, if load is sufficiently high, potentially dropped. Please see our docs for further information. |
Beta Was this translation helpful? Give feedback.
-
|
This is a known pain point — scheduled workflows can stop running for various reasons (60 days inactivity, repo forking, etc.) and there is no built-in notification. A workaround: add a heartbeat ping at the end of your workflow. An external monitor tracks the pings and alerts you when one is late. - name: Confirm run
if: success()
run: curl -fsS --retry 3 https://gabe.usegabe.workers.dev/ping/YOUR_IDOr use the Gabe GitHub Action for a cleaner setup. Free, open source. |
Beta Was this translation helpful? Give feedback.
👋 Thank you for reporting the issue with scheduled workflows not triggering. We identified a related change from last week that was rolled back today. Any commit pushed to the default branch will resync the impacted scheduled workflows and resolve any scheduling issues you may be experiencing. If you continue to experience issues with syncing schedules, please reply with a comment including the following:
Note: Schedules that run during periods of high load (e.g., midnight UTC) may be delayed or, if load is sufficiently high, potentially dropped. Please see our docs for further information.