Closed
Description
Description
Scheduled Gitea Actions are supposed to run on the default branch of the containing repository, but sometimes they run on branches that aren't the default. I haven't done enough testing to narrow down the circumstances, but it has so far always been a merged-and-deleted branch.
Given a workflow file like this:
---
on: # yamllint disable-line rule:truthy
schedule:
- cron: '*/15 * * * *'
jobs:
backup:
name: Backup DNS Zones
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Debug git status
run: |
git status
- name: Debug Gitea Actions variables
run: |-
echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF"
echo "GITHUB_REF: $GITHUB_HEAD_REF"
echo "GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME"
echo "…and a change to the workflow file to see if that is part of it"
If you create that in the default branch, it will run in the default branch as scheduled. However, once you create a PR and merge it (with branch auto-deletion turned on) it will start running the schedule on the deleted branch instead.
I've created a repository on try.gitea.io, but the screenshots are from my own instance.
Gitea Version
1.21.0
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots


Git Version
No response
Operating System
No response
How are you running Gitea?
Official Helm chart v9.5.1
Database
PostgreSQL