I’m realizing from the following links:
- Why a merge commit for pull requests? · Issue #504 · actions/checkout · GitHub
- Events that trigger workflows - GitHub Docs
On pull_request workflow triggers, actions/checkout uses the speculative mere commit of PR head → base branch head instead of the actual PR head itself. I kinda get why that was decided and in some ways, makes things easy and in some ways, hard.
But I wanted to understand how Vercel auto preview build + deploys behave. I was trying to move to a more GitHub Actions-centric workflow to do all builds + deploys (IDK why this is so difficult to do with Vercel) so was trying out manually building + deploying to Vercel from GitHub Actions using vercel CLI. I observed the following:
where right is after creating vercel project, where the initial commit was deployed to prod, where the links + commit info is all correct. But when I did vercel build + vercel deploy from GitHub workflow, I saw weird stuff which can now be explained because of pull_request behavior.
So, are Vercel auto deploys then always picking the head commit of a PR branch and is that why the branch/commit info is correct? If yes, does this mean that we cannot rely on pull_request events at all when working with Vercel GitHub integration since the results would be different for jobs running on Vercel vs GitHub Actions?
