Skip to content

Gitea Action via cron trigger running on older commit #35871

@capi

Description

@capi

Description

I have a Gitea Action that triggers via a schedule trigger, and suddenly since a few days it's being invoked with an older SHA hash from the main branch. I found older issues that this was related to some PR merging, and indeed this is a commit that was added via "Rebase & Fast-Forward" commit from a PR.

Relevant part from the workflow:

name: Deploy Server

on:
  workflow_dispatch:
  schedule:
    - cron: 'TZ=Europe/Vienna 0 16 * * 3' # every Wednesday 16:00 Europe/Vienna (Gitea extension compared to Github)

jobs:
  deploy:
    name: Deploy using ansible container
    runs-on: ubuntu-latest

    # Use the Ansible container image from the configured container registry.
    container:
      image: ${{ vars.CONTAINER_REGISTRY }}/acc-infrastructure-ansible:latest
      credentials:
        username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
        password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          path: ansible

There are two more newer commits on main that are being currently ignored by all workflows that have the same schedule trigger (both introduced via a PR that each merged using "Rebase & Fast-Forward" with "Delete branch" strategy.

From the attached action log, it can be seen that the checkout action explicitly pulled 9822779503e236710a7e07a348f1794b71854f72.
But this is not the latest, looking at the commit hashes the top latest 10 commits are:

commit a7624a1f7cd24f1b31e1c08e9a955668c3ec3a99
commit fab547dbd72006b4a3db5aa6a2bc68e5517870c5
commit 9822779503e236710a7e07a348f1794b71854f72    <-- that one was pulled
commit 9d5b7e13f9516d976683d3e95fc41e6438c1030e
commit 2cce06449bd24018ac835b16bdb048e95853e06d
commit ae86334419667080dcb7d2e8763d62471ecb1186
commit d5b4648d8b935bb483e3c97df122b052283995df
commit a652e6781aeb97bdd198afee0136b909ccfdc8a9
commit eaac53dc931b0e73a11de202cc67e26c5f685a8b
commit 4d6907faca2907e8ed883063ced530b2dc927ddc

Any hints how I can get the action to run against the latest on main again?

Gitea Version

1.25.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/capi/c032b919ff4c8d52b9d3dbd101e50297

Screenshots

No response

Git Version

No response

Operating System

Ubuntu 22.04 using Docker

How are you running Gitea?

Docker, image gitea/gitea:1.25.1

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions