[BUG] Manual Actions runs with `workflow_dispatch` always checks out a tree one commit out of date

I’m using Github Actions with my project for CI and automation, and I was particularly excited to use the newly-announced workflow-dispatch event for manual actions. However, I’ve encountered a pretty major bug in my time using it: any runs triggered by it seem to check out a tree that’s one commit older than the branch’s latest commit, even though the run says it’s using the latest commit.

See here for an example of the problem.

In this case, I’d submitted a patch to fix a bug we’d uncovered in an Actions run. However, after my colleague initiated a manual run with workflow_dispatch, we ran into the exact same error as before – even down to the line number: the Actions log says the Python script failed on line 59, but as is visible in the diff for the commit that the manual run should be running on (commit c0ffa83), line 59 was changed to something completely different, and line 60 is what should have prompted the error, if there was one.

What’s even stranger is that the exact same code and the exact same commit ran perfectly once it hit a scheduled re-run. The only conclusion I can draw is that Actions’ workflow_dispatch trigger is somehow bugged.

I’m probably missing something, but which part of this workflow checks out the code from the rest of your repository? I’m not really familiar with nginx, but I don’t think running a workflow_dispatch or other workflow automatically checks out your whole repository, does it? I have @actions/checkout in all of my workflows, but maybe you’re updating the files in some other way? How do they get into /usr/local/bin/?

Edit: I see you are pulling a container that copies some stuff into /usr/local/bin/. Are you sure the version you’re pulling is the one you want? Sorry if I’m totally off base

Hi @mbestavros,

To confirm the commit info with ‘workflow_dispatch’, i created a simple yaml as below:

name: manual check
on: [workflow_dispatch]
jobs:
  job1:
    runs-on: ubuntu-latest
    steps:
      - name: checkout 
        uses: actions/checkout@v2
      - name: check the update content
        run: |
          cat test.txt

Edit the test.txt(commit ff3db5f), and trigger manual workflow, confirmed the latest commit is included.
image

Hence, it seems that in your yaml code, you didn’t pull the correct content.
You can simply add uses: actions/checkout@v2 step in the workflow yaml, cat the file content for confirmation.

Thanks.

1 Like