GitHub Actions not using the latest commit from main branch on scheduled workflow
Hey everyone, I'm running into an issue that's driving me crazy. I'm working with an scenario where my GitHub Actions workflow, configured to run on a schedule, seems to be using an older commit from the main branch instead of the latest one. My workflow YAML file looks like this: ```yaml name: Scheduled Build on: schedule: - cron: '0 * * * *' jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 with: fetch-depth: 0 - name: Build run: | echo "Building the project..." # Build commands here ``` The cron job is supposed to trigger every hour, but I noticed that when I check the build logs, the commit hash reflects changes from several hours ago rather than the latest pushes to the `main` branch. I've also ensured that the repository settings allow GitHub Actions to access the latest commits. I've tried changing the `fetch-depth` option to `0`, as well as re-running the workflow manually, but it still picks up the older state. I've also checked the `Actions` tab to confirm that there are no pending workflows that should've run on recent commits. Any insights on how to ensure that the workflow always pulls the latest state of the repository on scheduled runs would be greatly appreciated. Also, is there a way to debug or log the commit being used within the workflow step to confirm exactly what it's working from? I'm on Windows 11 using the latest version of Yaml. What are your experiences with this?