Github Actions shows previous commit

The top bar of my Github Actions shows the commit before the one created by the action. For example, the top bar with the checkmark here us-cases-wiki-scrape shows 2ad2851 (“china-dxy-autoupdate”), but the most recent time this action ran, it created 2df9f5e (“us-wiki-autoupdate”). And 2ad2851 is the commit just before 2df9f5e. Why? Is it because it wants to show the commit on which it ran from? And how do I get this bar to show the commits this job (us-cases-wiki-scrape) creates?

@grighi,

Looks like, you have some misunderstandings for the commit ref (github.sha, or GITHUB_SHA) of the workflow.

Here are few points you need to know:

  • When a new run of the scheduled workflow is triggered, normally the commit ref of this run is the latest commit on the default branch. See schedule event.

  • Before the workflow run is triggered, the commit ref of this run should have been existing on the default branch.

  • Each workflow run only has one commit ref, and the commit ref can’t be changed to another commit.

  • The commit pushed in a workflow run is not the commit ref of current run. After this commit has been pushed to the repository, it can be the commit ref of the subsequent triggered runs.

In your case, when the run (347251714) of the scheduled workflow was triggered, the latest commit was “2ad2851”. So this run uses “2ad2851” as its commit ref. It’s the correct behavior.

In the workflow run (347251714), the commit “2df9f5e” was generated and pushed, as I mentioned above, it is not the commit ref of this run.


Is it because it wants to show the commit on which it ran from?

Yes, the title of a workflow run generally is the commit message of this run’s commit ref.

And how do I get this bar to show the commits this job (us-cases-wiki-scrape) creates?

We have no methods to change it. As I mentioned above, we can’t changed the commit ref of a workflow run to another commit, so we can’t change the displayed commit message to that of another commit.